desktop/windows: ajustar NSIS (perMachine, escolher diretório, atalho) e mover store para AppData
- tauri.conf.json: configura nsis (installMode perMachine, allowToChangeInstallDirectory, installDirName, createDesktopShortcut) - main.tsx: Store.load agora usa appLocalDataDir (dados do app em AppData do usuário) - README: documenta instalação Windows, dados em AppData e build leve (--bundles nsis)
This commit is contained in:
parent
682d39db70
commit
087170e321
5 changed files with 48 additions and 9 deletions
|
|
@ -28,7 +28,25 @@ VITE_API_BASE_URL=
|
|||
- Build executável (bundle):
|
||||
- `pnpm -C apps/desktop tauri build`
|
||||
|
||||
Saída dos pacotes: `apps/desktop/src-tauri/target/release/bundle/` (AppImage/deb/msi/dmg conforme SO).
|
||||
Saída dos pacotes: `apps/desktop/src-tauri/target/release/bundle/`.
|
||||
|
||||
### Windows (NSIS) — instalação e dados
|
||||
- Instalador NSIS com suporte a “perMachine” (Arquivos de Programas) e diretório customizável (ex.: `C:\Raven`).
|
||||
- Atalho é criado na Área de Trabalho apontando para o executável instalado.
|
||||
- Dados do app (token/config) ficam em AppData local do usuário (via `@tauri-apps/plugin-store` com `appLocalDataDir`).
|
||||
|
||||
Build rápido e leve em dev:
|
||||
```bash
|
||||
pnpm -C apps/desktop tauri build --bundles nsis
|
||||
```
|
||||
|
||||
Assinatura do updater (opcional em dev):
|
||||
```powershell
|
||||
$privB64 = '<COLE_SUA_CHAVE_PRIVADA_EM_BASE64>'
|
||||
$env:TAURI_SIGNING_PRIVATE_KEY = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($privB64))
|
||||
$env:TAURI_SIGNING_PRIVATE_KEY_PASSWORD = 'SENHA_AQUI'
|
||||
pnpm -C apps/desktop tauri build --bundles nsis
|
||||
```
|
||||
|
||||
## Pré‑requisitos Tauri
|
||||
- Rust toolchain instalado.
|
||||
|
|
|
|||
|
|
@ -38,16 +38,20 @@
|
|||
"bundle": {
|
||||
"active": true,
|
||||
"createUpdaterArtifacts": true,
|
||||
"targets": [
|
||||
"deb",
|
||||
"rpm",
|
||||
"nsis"
|
||||
],
|
||||
"targets": ["nsis", "deb", "rpm"],
|
||||
"icon": [
|
||||
"icons/icon.ico",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.png",
|
||||
"icons/Raven.png"
|
||||
]
|
||||
],
|
||||
"windows": {
|
||||
"nsis": {
|
||||
"installMode": "perMachine",
|
||||
"allowToChangeInstallDirectory": true,
|
||||
"installDirName": "Raven",
|
||||
"createDesktopShortcut": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|||
import { createRoot } from "react-dom/client"
|
||||
import { invoke } from "@tauri-apps/api/core"
|
||||
import { Store } from "@tauri-apps/plugin-store"
|
||||
import { appLocalDataDir } from "@tauri-apps/api/path"
|
||||
import { ExternalLink, Eye, EyeOff, GalleryVerticalEnd, Loader2, RefreshCw } from "lucide-react"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./components/ui/tabs"
|
||||
import { cn } from "./lib/utils"
|
||||
|
|
@ -103,7 +104,8 @@ const appUrl = normalizeUrl(import.meta.env.VITE_APP_URL, DEFAULT_APP_URL)
|
|||
const apiBaseUrl = normalizeUrl(import.meta.env.VITE_API_BASE_URL, appUrl)
|
||||
|
||||
async function loadStore(): Promise<Store> {
|
||||
return await Store.load(STORE_FILENAME)
|
||||
const dir = await appLocalDataDir()
|
||||
return await Store.load(STORE_FILENAME, { dir })
|
||||
}
|
||||
|
||||
async function readToken(store: Store): Promise<string | null> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue