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
4 changes: 4 additions & 0 deletions app/src-tauri/tauri.bundle.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
1 change: 1 addition & 0 deletions app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"bundle": {
"active": true,
"copyright": "Copyright 2026 Phelipe Lorran",
"targets": [
"nsis"
],
Expand Down
13 changes: 13 additions & 0 deletions app/src-tauri/windows/hooks.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -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\<publisher>\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
Expand Down
Binary file added app/src-tauri/windows/installer-header.bmp
Binary file not shown.
Binary file added app/src-tauri/windows/installer-sidebar.bmp
Binary file not shown.
1 change: 1 addition & 0 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<target triple>.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 `<home>\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\<publisher>\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
Expand Down
Loading