Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions installer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions installer/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ light or dark mode, the accent color and whether the taskbar hides automatically
package with no declared install scope, so winget installs it per user, same as Oh My Posh,
Starship and eza above (with the same `--accept-package-agreements`/`--accept-source-agreements`).
Uninstall removes it only if this setup installed it, the same as PowerShell 7.
- **Allow Windows PowerShell 5.1 to run profile scripts** (off by default): runs
`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. This is a **security setting**: it lets
- **Allow Windows PowerShell 5.1 to run profile scripts** (off by default): sets
the same registry value as `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. This is a **security setting**: it lets
Windows PowerShell 5.1 run scripts stored on this computer, while scripts downloaded from the
internet still need a signature. Without it, Windows PowerShell 5.1 doesn't load your profile,
so ii's terminal look only appears in PowerShell 7, which allows this already. Nothing is
Expand Down Expand Up @@ -211,7 +211,8 @@ Uninstall reads `install-manifest.json` and undoes what it lists:
- puts the PowerShell execution policy back, if this setup changed it;
- uninstalls with winget the terminal tools this setup installed (an option, on by default;
PowerShell 7 and FFmpeg too, each as its own option, if this setup installed them), then
removes winget itself (`Remove-AppxPackage`) if this setup installed it on Windows 10, and
removes winget itself (through Windows' `PackageManager`, like `Remove-AppxPackage`) if this
setup installed it on Windows 10, and
removes the fonts it installed;
- deletes the Windows Terminal fragment folder, `%LOCALAPPDATA%\ii-windows`, ii's folders in
`%LOCALAPPDATA%\quickshell` (`ii`, `State`, `cache`, `run`, but not `State\user`),
Expand Down Expand Up @@ -289,12 +290,13 @@ recommended), next to Windows 11. A few things work differently there:
update never adds winget you didn't ask for) downloads the App Installer package and its dependencies
(about 300 MB together) from the latest release of
[microsoft/winget-cli](https://github.com/microsoft/winget-cli) on GitHub, and installs it for
your user with `Add-AppxPackage` - no administrator permission. Some winget-cli releases
your user through Windows' `PackageManager` (the API behind `Add-AppxPackage`, called directly,
without PowerShell) - no administrator permission. Some winget-cli releases
publish the msixbundle's SHA-256 next to it; when that's there, it's checked before installing,
and this setup says so; when it isn't, this setup doesn't invent a check of its own, since
Windows checks the package's own Microsoft signature on install anyway. Turning the toggle off
skips this (same as before: the terminal tools and FFmpeg are skipped too). Uninstall removes
it with `Remove-AppxPackage`, only if this setup installed it. A failed download or install
it the same way, only if this setup installed it. A failed download or install
here is a warning, not a failed setup: the terminal tools and FFmpeg are then skipped exactly
as they are when winget was never found.
- **Windows Terminal** isn't built into Windows 10. If the *Terminal setup* option is on and
Expand Down
16 changes: 9 additions & 7 deletions installer/README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ tarefas se oculta automaticamente.
de instalação declarado, então o winget o instala por usuário, do mesmo jeito que o Oh My Posh,
o Starship e o eza acima (com os mesmos `--accept-package-agreements`/`--accept-source-agreements`).
A desinstalação o remove só se foi este instalador que o instalou, assim como o PowerShell 7.
- **Permitir que o Windows PowerShell 5.1 rode scripts de perfil** (desligada por padrão): roda
`Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. É uma **configuração de segurança**:
- **Permitir que o Windows PowerShell 5.1 rode scripts de perfil** (desligada por padrão): grava
o mesmo valor no registro que o `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. É uma **configuração de segurança**:
deixa o Windows PowerShell 5.1 rodar scripts guardados neste computador, enquanto scripts
baixados da internet continuam precisando de assinatura. Sem ela, o Windows PowerShell 5.1 não
carrega o seu perfil, e o visual de terminal do ii só aparece no PowerShell 7, que já permite
Expand Down Expand Up @@ -226,8 +226,9 @@ A desinstalação lê o `install-manifest.json` e desfaz o que está nele:
- volta a política de execução do PowerShell, se este instalador a mudou;
- desinstala com o winget as ferramentas de terminal que este instalador instalou (uma opção,
ligada por padrão; o PowerShell 7 e o FFmpeg também, cada um como sua própria opção, se foi
este instalador que os instalou), depois remove o próprio winget (`Remove-AppxPackage`) se foi
este instalador que o instalou no Windows 10, e remove as fontes que ele instalou;
este instalador que os instalou), depois remove o próprio winget (pelo `PackageManager` do
Windows, como o `Remove-AppxPackage`) se foi este instalador que o instalou no Windows 10, e
remove as fontes que ele instalou;
- apaga a pasta do fragmento do Windows Terminal, `%LOCALAPPDATA%\ii-windows`, as pastas do ii em
`%LOCALAPPDATA%\quickshell` (`ii`, `State`, `cache`, `run`, mas não `State\user`),
`%LOCALAPPDATA%\cache\quickshell` e `%TEMP%\quickshell`, e também
Expand Down Expand Up @@ -308,13 +309,14 @@ O ii-windows também instala no Windows 10 versão 2004 ou mais nova (build 1904
por padrão na instalação; desligada na atualização e no reparo, para uma atualização nunca
trazer um winget que você não pediu) baixa o pacote do Instalador de Aplicativo e as dependências dele (cerca de 300 MB
juntos) da versão mais nova do [microsoft/winget-cli](https://github.com/microsoft/winget-cli)
no GitHub, e o instala para o seu usuário com `Add-AppxPackage` - sem precisar de permissão de
no GitHub, e o instala para o seu usuário pelo `PackageManager` do Windows (a API por trás do
`Add-AppxPackage`, chamada direto, sem PowerShell) - sem precisar de permissão de
administrador. Algumas versões do winget-cli publicam o SHA-256 do msixbundle ao lado dele;
quando isso existe, é conferido antes de instalar, e este instalador avisa; quando não existe,
este instalador não inventa uma verificação própria, já que o Windows confere a assinatura da
Microsoft do pacote ao instalar, de qualquer jeito. Desligar essa opção pula essa etapa (como
antes: as ferramentas de terminal e o FFmpeg também são pulados). A desinstalação o remove com
`Remove-AppxPackage`, só se foi este instalador que o instalou. Um download ou instalação que
antes: as ferramentas de terminal e o FFmpeg também são pulados). A desinstalação o remove do
mesmo jeito, só se foi este instalador que o instalou. Um download ou instalação que
falhe aqui é um aviso, não um instalador que falhou: as ferramentas de terminal e o FFmpeg são
então pulados, exatamente como quando o winget nunca foi encontrado.
- O **Windows Terminal** não vem com o Windows 10. Se a opção *Configuração do terminal* estiver
Expand Down
2 changes: 2 additions & 0 deletions installer/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ struct InstalledInfo {
tools: Vec<String>,
pwsh7_ours: bool,
ffmpeg_ours: bool,
app_installer_ours: bool,
fonts: usize,
profiles: Vec<String>,
exec_policy_changed: bool,
Expand Down Expand Up @@ -175,6 +176,7 @@ fn info(state: tauri::State<'_, AppState>) -> Info {
.collect(),
pwsh7_ours: m.has_winget(iiw_setup_core::PWSH_WINGET_ID),
ffmpeg_ours: m.has_winget(iiw_setup_core::FFMPEG_WINGET_ID),
app_installer_ours: m.items.app_installer.is_some(),
fonts: m.items.fonts.len(),
profiles: m.items.profiles.iter().map(|p| p.path.display().to_string()).collect(),
exec_policy_changed: m.items.exec_policy.as_ref().is_some_and(|c| c.changed),
Expand Down
4 changes: 4 additions & 0 deletions installer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ pulldown-cmark = { version = "0.13", default-features = false, features = ["html

[target.'cfg(windows)'.dependencies]
winreg = "0.55"
windows-collections = "0.3"
windows-future = "0.3"
windows = { version = "0.62", features = [
"ApplicationModel",
"Management_Deployment",
"Win32_Foundation",
"Win32_Globalization",
"Win32_Graphics_Gdi",
Expand Down
35 changes: 13 additions & 22 deletions installer/core/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,17 +1402,12 @@ fn install_app_installer(ctx: &mut Ctx, m: &mut Manifest) {
if reporter.cancelled() {
return Err(Msg::new("cancelled", "cancelled"));
}
ctx.info(" Add-AppxPackage (per user)");
let out = win::install_appx_bundle(&msixbundle_path, &dep_paths).map_err(|e| io_msg("io", "Add-AppxPackage", e))?;
ctx.info(format!(" {}", out.text().replace('\n', "\n ")));
if !out.success() {
return Err(Msg::new(
"winget_install_failed",
format!("Add-AppxPackage couldn't install winget (exit {:?})", out.code),
)
.with("code", format!("{:?}", out.code.map(|c| c as u32))));
}
Ok(())
ctx.info(" installing the package for this user");
win::install_appx_bundle(&msixbundle_path, &dep_paths).map_err(|e| {
let code = format!("0x{:08X}", e.code().0 as u32);
Msg::new("winget_install_failed", format!("Windows couldn't install winget ({code}): {}", e.message()))
.with("code", code)
})
})();
let _ = fsops::remove_any(&dir);
match result {
Expand Down Expand Up @@ -2374,29 +2369,25 @@ pub fn uninstall(ctx: &mut Ctx, run: &RunOptions) -> bool {
}
}
if run.remove_tools && app_installer_ours {
ctx.info(format!(" Get-AppxPackage -Name {} | Remove-AppxPackage", crate::APP_INSTALLER_NAME));
ctx.info(format!(" removing the {} package for this user", crate::APP_INSTALLER_NAME));
match win::remove_appx_package(crate::APP_INSTALLER_NAME) {
Ok(out) if out.success() => {
ctx.info(format!(" {}", out.text().replace('\n', "\n ")));
Ok(removed) => {
ctx.info(format!(" {removed} package(s) removed"));
m.items.app_installer = None;
save(ctx, &m);
}
Ok(out) => {
Err(e) => {
failed = true;
ctx.info(format!(" {}", out.text().replace('\n', "\n ")));
let code = format!("0x{:08X}", e.code().0 as u32);
ctx.warn(
"tools",
Msg::new(
"winget_uninstall_failed",
format!("Couldn't remove App Installer (exit {:?})", out.code),
format!("Couldn't remove App Installer ({code}): {}", e.message()),
)
.with("code", format!("{:?}", out.code.map(|c| c as u32))),
.with("code", code),
);
}
Err(e) => {
failed = true;
ctx.warn("tools", io_msg("winget_uninstall_failed", "Remove-AppxPackage", e));
}
}
}
if !failed {
Expand Down
Loading
Loading