Skip to content

Commit

Permalink
silent installation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mirtlecn committed Dec 21, 2023
1 parent c671b90 commit 30da93a
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions output/install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ LangString LNKFORAPPFOLDER ${LANG_TRADCHINESE} "【小狼毫】程序文件夾"
LangString LNKFORUPDATER ${LANG_TRADCHINESE} "【小狼毫】檢查新版本"
LangString LNKFORSETUP ${LANG_TRADCHINESE} "【小狼毫】安裝選項"
LangString LNKFORUNINSTALL ${LANG_TRADCHINESE} "卸載小狼毫"
LangString UNINSTALLWARN ${LANG_TRADCHINESE} "安裝前,我打盤先卸載舊版本的小狼毫。$\n$\n按下「確定」移除舊版本,按下「取消」放棄本次安裝。"
LangString WARN ${LANG_TRADCHINESE} "安裝前,我打盤先卸載舊版本的小狼毫。$\n$\n按下「確定」移除舊版本,按下「取消」放棄本次安裝。"

!insertmacro MUI_LANGUAGE "SimpChinese"
LangString DISPLAYNAME ${LANG_SIMPCHINESE} "小狼毫输入法"
Expand All @@ -92,22 +92,22 @@ LangString LNKFORAPPFOLDER ${LANG_SIMPCHINESE} "【小狼毫】程序文件夹"
LangString LNKFORUPDATER ${LANG_SIMPCHINESE} "【小狼毫】检查新版本"
LangString LNKFORSETUP ${LANG_SIMPCHINESE} "【小狼毫】安装选项"
LangString LNKFORUNINSTALL ${LANG_SIMPCHINESE} "卸载小狼毫"
LangString DUNINSTALLWARN ${LANG_SIMPCHINESE} '安装前,请先卸载旧版本的小狼毫。$\n$\n点击 "确定" 移除旧版本,或点击 "取消" 放弃本次安装。'
LangString WARN ${LANG_SIMPCHINESE} '安装前,请先卸载旧版本的小狼毫。$\n$\n点击 "确定" 移除旧版本,或点击 "取消" 放弃本次安装。'

!insertmacro MUI_LANGUAGE "English"
LangString DISPLAYNAME ${LANG_ENGLISH} "Weasel"
LangString LNKFORMANUAL ${LANG_ENGLISH} "[Weasel] Manual"
LangString LNKFORSETTING ${LANG_ENGLISH} "[Weasel] Settings"
LangString LNKFORDICT ${LANG_ENGLISH} "[Weasel] Dictionary Manager"
LangString LNKFORSYNC ${LANG_ENGLISH} "[Weasel] Sync User Profile"
LangString LNKFORDEPLOY ${LANG_ENGLISH} "[Weasel] Deploy"
LangString LNKFORMANUAL ${LANG_ENGLISH} "Weasel Manual"
LangString LNKFORSETTING ${LANG_ENGLISH} "Weasel Settings"
LangString LNKFORDICT ${LANG_ENGLISH} "Weasel Dictionary Manager"
LangString LNKFORSYNC ${LANG_ENGLISH} "Weasel Sync User Profile"
LangString LNKFORDEPLOY ${LANG_ENGLISH} "Weasel Deploy"
LangString LNKFORSERVER ${LANG_ENGLISH} "Weasel Server"
LangString LNKFORUSERFOLDER ${LANG_ENGLISH} "[Weasel] User Folder"
LangString LNKFORAPPFOLDER ${LANG_ENGLISH} "[Weasel] App Folder"
LangString LNKFORUPDATER ${LANG_ENGLISH} "[Weasel] Check for Updates"
LangString LNKFORSETUP ${LANG_ENGLISH} "[Weasel] Installation Preference"
LangString LNKFORUSERFOLDER ${LANG_ENGLISH} "Weasel User Folder"
LangString LNKFORAPPFOLDER ${LANG_ENGLISH} "Weasel App Folder"
LangString LNKFORUPDATER ${LANG_ENGLISH} "Weasel Check for Updates"
LangString LNKFORSETUP ${LANG_ENGLISH} "Weasel Installation Preference"
LangString LNKFORUNINSTALL ${LANG_ENGLISH} "Uninstall Weasel"
LangString UNINSTALLWARN ${LANG_ENGLISH} "Before installation, please uninstall the old version of Weasel first.$\n$\nPress 'OK' to remove the old version, or 'Cancel' to abort installation."
LangString WARN ${LANG_ENGLISH} "Before installation, please uninstall the old version of Weasel.$\n$\nPress 'OK' to remove the old version, or 'Cancel' to abort installation."

;--------------------------------

Expand All @@ -119,7 +119,7 @@ Function .onInit

StrCpy $0 "Upgrade"
IfSilent uninst 0
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "$(UNINSTALLWARN)" IDOK uninst
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "$(WARN)" IDOK uninst
Abort

uninst:
Expand Down Expand Up @@ -210,7 +210,7 @@ program_files:
SetOutPath $INSTDIR

; test /T flag for zh_TW locale
StrCpy $R2 "/i"
StrCpy $R2 "/i"
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 "/S" $R1
Expand All @@ -234,7 +234,13 @@ program_files:
WriteUninstaller "$INSTDIR\uninstall.exe"

; run as user...
ExecWait "$INSTDIR\WeaselDeployer.exe /install"
IfSilent +2
ExecWait "$INSTDIR\WeaselDeployer.exe /install"
Goto deploy_done

ExecWait "$INSTDIR\WeaselDeployer.exe /deploy"
deploy_done:
; ...

; Write autorun key
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "WeaselServer" "$INSTDIR\WeaselServer.exe"
Expand Down

0 comments on commit 30da93a

Please sign in to comment.