feat: NSIS 中文安装器(年糕历险记-Setup-v0.1.0.exe 实际构建+静默安装验证)、菜单鼠标可见性修复、首页 UI 原版复刻(土质背景/原版按钮/splash/版本角标)、全 goroutine 崩溃兜底
This commit is contained in:
58
tools/nsis/nsis-3.10/Examples/MultiUser.nsi
Normal file
58
tools/nsis/nsis-3.10/Examples/MultiUser.nsi
Normal file
@@ -0,0 +1,58 @@
|
||||
Name "MultiUser example"
|
||||
OutFile "MultiUser.exe"
|
||||
|
||||
!define UNINSTKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
|
||||
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${UNINSTKEY}"
|
||||
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "CurrentUser"
|
||||
!define MULTIUSER_INSTALLMODE_INSTDIR "$(^Name)"
|
||||
!define MULTIUSER_INSTALLMODE_COMMANDLINE
|
||||
!define MULTIUSER_EXECUTIONLEVEL Highest
|
||||
!define MULTIUSER_MUI
|
||||
|
||||
!include "LogicLib.nsh"
|
||||
!include "MultiUser.nsh"
|
||||
!include "MUI2.nsh"
|
||||
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
!insertmacro MULTIUSER_PAGE_INSTALLMODE
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
Function .onInit
|
||||
!insertmacro MULTIUSER_INIT
|
||||
FunctionEnd
|
||||
|
||||
Function un.onInit
|
||||
!insertmacro MULTIUSER_UNINIT
|
||||
FunctionEnd
|
||||
|
||||
Section
|
||||
SetOutPath "$InstDir"
|
||||
WriteUninstaller "$InstDir\Uninstall.exe"
|
||||
WriteRegStr ShCtx "${UNINSTKEY}" DisplayName "$(^Name)"
|
||||
WriteRegStr ShCtx "${UNINSTKEY}" UninstallString '"$InstDir\Uninstall.exe"'
|
||||
WriteRegStr ShCtx "${UNINSTKEY}" $MultiUser.InstallMode 1 ; Write MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME so the correct context can be detected in the uninstaller.
|
||||
|
||||
!tempfile APP
|
||||
!makensis '-v2 "-DOUTFILE=${APP}" "-DNAME=NsisMultiUserExample" -DCOMPANY=Nullsoft "AppGen.nsi"' = 0
|
||||
File "/oname=$InstDir\MyApp.exe" "${APP}" ; Pretend that we have a real application to install
|
||||
!delfile "${APP}"
|
||||
SectionEnd
|
||||
|
||||
Section "Start Menu shortcut"
|
||||
CreateShortcut /NoWorkingDir "$SMPrograms\$(^Name).lnk" "$InstDir\MyApp.exe"
|
||||
SectionEnd
|
||||
|
||||
Section "-Uninstall"
|
||||
Delete "$SMPrograms\$(^Name).lnk"
|
||||
|
||||
Delete "$InstDir\MyApp.exe"
|
||||
Delete "$InstDir\Uninstall.exe"
|
||||
DeleteRegKey ShCtx "${UNINSTKEY}"
|
||||
RMDir $InstDir
|
||||
SectionEnd
|
||||
Reference in New Issue
Block a user