fix(app): shortcut icons in start menu folders and any install folder, updates go where Jarvis is
- The icon pass also walks the start menus' folders, so a shortcut kept in one (and a later icon change) is not missed. - The install folder and icon path reach PowerShell through the environment: a folder name with an apostrophe broke the whole command. A failure is now a line in the install details. - InstallDirRegKey read the 32-bit registry view before .onInit switched to the 64-bit one where the folder is written, so a silent update of Jarvis installed elsewhere put a second copy in Program Files. .onInit now reads the 64-bit key; a folder given with /D wins. - Version 0.1.12. Checked on the Windows VM with Jarvis 0.1.6 in C:\Tools\Kim's Jarvis and shortcuts on both desktops and in start menu subfolders: 0.1.11 left the desktop and subfolder shortcuts old; 0.1.12 (no /D) updated that folder and every shortcut, and a fresh 0.1.12 still goes to Program Files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2
app/Cargo.lock
generated
2
app/Cargo.lock
generated
@@ -1520,7 +1520,7 @@ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
|
||||
|
||||
[[package]]
|
||||
name = "jarvis-app"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "jarvis-app"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
edition = "2021"
|
||||
rust-version = "1.85"
|
||||
description = "Jarvis v2 Windows app core: Discord voice, voice worker supervisor, chat channels"
|
||||
|
||||
4
app/shell/Cargo.lock
generated
4
app/shell/Cargo.lock
generated
@@ -2637,7 +2637,7 @@ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
|
||||
|
||||
[[package]]
|
||||
name = "jarvis-app"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.22.1",
|
||||
@@ -2666,7 +2666,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "jarvis-shell"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
dependencies = [
|
||||
"jarvis-app",
|
||||
"serde_json",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "jarvis-shell"
|
||||
version = "0.1.11"
|
||||
version = "0.1.12"
|
||||
edition = "2021"
|
||||
rust-version = "1.85"
|
||||
description = "Jarvis v2 management app window (Tauri 2 over the app core's AdminApi)"
|
||||
|
||||
@@ -19,7 +19,6 @@ SetCompressor /SOLID lzma
|
||||
Name "Jarvis"
|
||||
OutFile "${OUT}"
|
||||
InstallDir "$PROGRAMFILES64\Jarvis"
|
||||
InstallDirRegKey HKLM "Software\JarvisBot" "InstallDir"
|
||||
RequestExecutionLevel admin
|
||||
BrandingText "Jarvis ${VERSION}"
|
||||
VIProductVersion "${VERSION}.0"
|
||||
@@ -149,6 +148,13 @@ Function .onInit
|
||||
Abort
|
||||
${EndIf}
|
||||
SetRegView 64
|
||||
; An update goes where Jarvis is installed (the key is in the 64-bit view, which InstallDirRegKey
|
||||
; would not read); a folder given with /D wins.
|
||||
ReadRegStr $0 HKLM "Software\JarvisBot" "InstallDir"
|
||||
${If} $0 != ""
|
||||
${AndIf} $INSTDIR == "$PROGRAMFILES64\Jarvis"
|
||||
StrCpy $INSTDIR $0
|
||||
${EndIf}
|
||||
; Shortcuts for every user of the PC, like the Program Files install itself.
|
||||
SetShellVarContext all
|
||||
!insertmacro TakeLock
|
||||
@@ -248,13 +254,20 @@ Section /o "바탕 화면 바로 가기" SecDesktop
|
||||
CreateShortCut "$DESKTOP\Jarvis.lnk" "$INSTDIR\jarvis.exe" "" "$INSTDIR\${ICON_FILE}" 0
|
||||
SectionEnd
|
||||
|
||||
; Every shortcut to jarvis.exe on the desktops and in the start menus (the person's own too, and the
|
||||
; installer's from an earlier version, which an update does not make again) shows this version's
|
||||
; icon file; then Explorer redraws its icons. The 64-bit PowerShell (SysNative from this 32-bit
|
||||
; installer): a 32-bit one reads a link to Program Files as one to Program Files (x86).
|
||||
; Every shortcut to jarvis.exe on the desktops and in the start menus, their folders included (the
|
||||
; person's own too, and the installer's from an earlier version, which an update does not make
|
||||
; again) shows this version's icon file; then Explorer redraws its icons. The paths go in through
|
||||
; the environment, so no install folder name can break the command. The 64-bit PowerShell
|
||||
; (SysNative from this 32-bit installer): a 32-bit one reads a link to Program Files as one to
|
||||
; Program Files (x86).
|
||||
Section "-Icons"
|
||||
nsExec::Exec `"$WINDIR\SysNative\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -Command "$$w = New-Object -ComObject WScript.Shell; foreach ($$d in 'Desktop', 'CommonDesktopDirectory', 'Programs', 'CommonPrograms') { Get-ChildItem -LiteralPath ([Environment]::GetFolderPath($$d)) -Filter *.lnk -EA 0 | ForEach-Object { $$l = $$w.CreateShortcut($$_.FullName); if ($$l.TargetPath -ieq '$INSTDIR\jarvis.exe') { $$l.IconLocation = '$INSTDIR\${ICON_FILE},0'; $$l.Save() } } }"`
|
||||
System::Call 'kernel32::SetEnvironmentVariable(t "JARVIS_EXE", t "$INSTDIR\jarvis.exe")'
|
||||
System::Call 'kernel32::SetEnvironmentVariable(t "JARVIS_ICON", t "$INSTDIR\${ICON_FILE},0")'
|
||||
nsExec::Exec `"$WINDIR\SysNative\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NonInteractive -Command "$$w = New-Object -ComObject WScript.Shell; foreach ($$d in 'Desktop', 'CommonDesktopDirectory', 'Programs', 'CommonPrograms') { Get-ChildItem -LiteralPath ([Environment]::GetFolderPath($$d)) -Filter *.lnk -Recurse:($$d -like '*Programs') -EA 0 | ForEach-Object { $$l = $$w.CreateShortcut($$_.FullName); if ($$l.TargetPath -ieq $$env:JARVIS_EXE) { $$l.IconLocation = $$env:JARVIS_ICON; $$l.Save() } } }"`
|
||||
Pop $0
|
||||
${If} $0 != 0
|
||||
DetailPrint "바로 가기 아이콘을 바꾸지 못했습니다 ($0)"
|
||||
${EndIf}
|
||||
System::Call 'shell32::SHChangeNotify(i 0x08000000, i 0, p 0, p 0)' ; SHCNE_ASSOCCHANGED
|
||||
SectionEnd
|
||||
|
||||
|
||||
@@ -834,7 +834,9 @@ both to a release with that tag. The repository's other releases (v1's `v1.x`) a
|
||||
`Jarvis-Setup-<version>.exe` with its `.sha256`. The installer is about 10 MB; models and runtimes
|
||||
come with the first-run wizard into the data folder, which the installer never touches.
|
||||
|
||||
- Program Files (`Jarvis`), one administrator prompt, 64-bit Windows 10/11 only; Korean pages:
|
||||
- Program Files (`Jarvis`), or where Jarvis is already installed (`HKLM\Software\JarvisBot`
|
||||
`InstallDir`, 64-bit view; a folder given with `/D` wins), one administrator prompt, 64-bit
|
||||
Windows 10/11 only; Korean pages:
|
||||
folder, components, progress, finish ("Jarvis 실행", started through Explorer so the app runs as
|
||||
the signed-in user, not as administrator).
|
||||
- Components: Jarvis (always), start menu shortcut (on), desktop shortcut (off), the virtual
|
||||
@@ -847,8 +849,9 @@ come with the first-run wizard into the data folder, which the installer never t
|
||||
content (`jarvis-<sha256 prefix>.ico`; the old one is deleted), because Windows keeps an icon it
|
||||
has shown by its path and a changed icon under the old path stays old on the desktop and in
|
||||
search. After the shortcuts, every `.lnk` to `jarvis.exe` on the desktops and in the start menus
|
||||
(the installing user's and every user's, the person's own and an earlier version's included)
|
||||
gets this icon file, and Explorer is told to redraw (`SHCNE_ASSOCCHANGED`).
|
||||
and their folders (the installing user's and every user's, the person's own and an earlier
|
||||
version's included) gets this icon file (the paths reach PowerShell through the environment, so
|
||||
any folder name works; a failure is a line in the details), and Explorer is told to redraw (`SHCNE_ASSOCCHANGED`).
|
||||
- The WebView2 runtime is installed with Microsoft's bootstrapper (inside the installer) only when
|
||||
the PC has none, before any file is copied. When it is still missing afterwards the installer
|
||||
asks to retry or cancel; silently it stops with exit code 3, nothing installed and nothing
|
||||
|
||||
Reference in New Issue
Block a user