diff --git a/app/src-tauri/tauri.bundle.conf.json b/app/src-tauri/tauri.bundle.conf.json index 76752f65..fc42e1dc 100644 --- a/app/src-tauri/tauri.bundle.conf.json +++ b/app/src-tauri/tauri.bundle.conf.json @@ -6,6 +6,10 @@ "windows": { "nsis": { "installMode": "currentUser", + "installerIcon": "icons/icon.ico", + "uninstallerIcon": "icons/icon.ico", + "sidebarImage": "windows/installer-sidebar.bmp", + "headerImage": "windows/installer-header.bmp", "languages": ["English", "PortugueseBR", "Spanish"], "installerHooks": "./windows/hooks.nsh" } diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 007939e9..0d8b1814 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -37,6 +37,7 @@ }, "bundle": { "active": true, + "copyright": "Copyright 2026 Phelipe Lorran", "targets": [ "nsis" ], diff --git a/app/src-tauri/windows/hooks.nsh b/app/src-tauri/windows/hooks.nsh index af8e7fcc..8aa931cf 100644 --- a/app/src-tauri/windows/hooks.nsh +++ b/app/src-tauri/windows/hooks.nsh @@ -2,6 +2,19 @@ ; data folder as a scheduled task, so installing or updating the app never ; touches it; the app updates the daemon when it next opens. +; The header image (installer-header.bmp) sits on the right of each page, +; next to the title, as the Botloft mascot on the page's white. +!define MUI_HEADERIMAGE_RIGHT + +!macro NSIS_HOOK_POSTINSTALL + ; Installed apps shows Botloft as the publisher. `bundle.publisher` stays + ; unset on purpose: Tauri also names the key that keeps the install folder + ; after it (Software\\Botloft), so a new name would make the + ; first update of an existing install run the old uninstaller without its + ; folder. + WriteRegStr SHCTX "${UNINSTKEY}" "Publisher" "Botloft" +!macroend + !macro NSIS_HOOK_PREUNINSTALL ; A real uninstall stops the daemon and removes its scheduled task and ; binary. Bots and data stay in %LOCALAPPDATA%\Botloft. An update runs diff --git a/app/src-tauri/windows/installer-header.bmp b/app/src-tauri/windows/installer-header.bmp new file mode 100644 index 00000000..deb54c86 Binary files /dev/null and b/app/src-tauri/windows/installer-header.bmp differ diff --git a/app/src-tauri/windows/installer-sidebar.bmp b/app/src-tauri/windows/installer-sidebar.bmp new file mode 100644 index 00000000..c9d578ba Binary files /dev/null and b/app/src-tauri/windows/installer-sidebar.bmp differ diff --git a/docs/spec.md b/docs/spec.md index 92953fcf..7c9f6ec3 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -704,6 +704,7 @@ Identidade: o mascote do Botloft é uma chama com olhos. O ícone do app (`app/a - `pnpm bundle` (em `app/`) roda `scripts/sidecar.mjs`, que compila o `botloftd` em release e o copia para `src-tauri/binaries/botloftd-.exe`, e depois `tauri build --config src-tauri/tauri.bundle.conf.json`. Esse arquivo liga o `externalBin` e o NSIS; ele fica fora do `tauri.conf.json` porque o `tauri-build` copia o `externalBin` também em dev e no `cargo clippy`, o que exigiria o sidecar em todo build e sobrescreveria o `target\debug\botloftd.exe` com a cópia de release. - NSIS por usuário (`installMode = currentUser`), sem pedir administrador, em `%LOCALAPPDATA%\Botloft` (seção 5). O instalador não mexe no daemon: ele roda da própria cópia em `\bin`, então o arquivo do sidecar nunca está em uso. - Hook `NSIS_HOOK_PREUNINSTALL` (`src-tauri/windows/hooks.nsh`): numa desinstalação de verdade, `botloftd service uninstall` para o daemon e apaga a tarefa e o binário, e o valor `Botloft` da chave Run sai (15.2); bots e dados ficam. Uma atualização também roda o desinstalador antigo, com `/UPDATE`: aí o hook não faz nada e o daemon continua rodando até o app novo abrir e atualizá-lo (15.2). +- Marca do instalador, sem nome de terceiros à vista: o instalador e o desinstalador usam o ícone do app (`icons/icon.ico`); as telas de boas-vindas e de conclusão têm a imagem lateral `windows/installer-sidebar.bmp` (164×314, o mascote e "Botloft" sobre o preto) e as outras telas o cabeçalho `windows/installer-header.bmp` (150×57, à direita, com `MUI_HEADERIMAGE_RIGHT` no arquivo de hooks). As duas imagens saem do `app-icon.svg` sem o quadrado preto. O rodapé mostra o `bundle.copyright` no lugar de "Nullsoft Install System", e o `NSIS_HOOK_POSTINSTALL` grava "Botloft" como editor em Aplicativos instalados. O `bundle.publisher` fica vazio de propósito: o Tauri dá o nome dele à chave que guarda a pasta de instalação (`Software\\Botloft`, hoje `github`, a segunda parte do identificador), e trocá-lo faria a primeira atualização de uma instalação existente rodar o desinstalador antigo sem a pasta. Por isso a empresa nas propriedades do `Botloft.exe` continua `github`. - O manifesto do app (`src-tauri/windows/app.manifest`) é o padrão do Tauri (controles comuns v6) mais `longPathAware`. ### 15.5 Atualizações