Skip to content

Commit

Permalink
install: don't redirect for autorun setting on 64 bit system
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Apr 20, 2024
1 parent 1f4be3c commit 0268869
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion output/install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Section "Weasel"
SectionIn RO

; Write the new installation path into the registry
; redirect on 64 bit system
; HKLM SOFTWARE\WOW6432Node\Rime\Weasel "InstallDir" "$INSTDIR"
WriteRegStr HKLM SOFTWARE\Rime\Weasel "InstallDir" "$INSTDIR"

; Reset INSTDIR for the new version
Expand Down Expand Up @@ -282,6 +284,12 @@ program_files:
deploy_done:
; ...

; don't redirect on 64 bit system for auto run setting
${If} ${IsNativeARM64}
SetRegView 64
${ElseIf} ${IsNativeAMD64}
SetRegView 64
${Endif}
; Write autorun key
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "WeaselServer" "$INSTDIR\WeaselServer.exe"
; Start WeaselServer
Expand Down Expand Up @@ -322,9 +330,15 @@ Section "Uninstall"
ExecWait '"$INSTDIR\WeaselSetup.exe" /u'

; Remove registry keys
DeleteRegKey HKLM SOFTWARE\Rime
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Weasel"
; don't redirect on 64 bit system for auto run setting
${If} ${IsNativeARM64}
SetRegView 64
${ElseIf} ${IsNativeAMD64}
SetRegView 64
${Endif}
DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "WeaselServer"
DeleteRegKey HKLM SOFTWARE\Rime

; Remove files and uninstaller
SetOutPath $TEMP
Expand Down

0 comments on commit 0268869

Please sign in to comment.