Skip to content

Commit

Permalink
Windows安装程序,自动检测上次安装目录。卸载提示备份数据
Browse files Browse the repository at this point in the history
  • Loading branch information
xianyunleo committed Jan 12, 2024
1 parent ddf4adb commit b0e0091
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
[*.{js,nsh}]
indent_size = 4

[*.config.js]
Expand Down
23 changes: 18 additions & 5 deletions build/installer.nsh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
!macro preInit
Var /GLOBAL installDir
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
ReadRegStr $installDir HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation
${if} $installDir == ""
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
${endif}

ReadRegStr $installDir HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation
${if} $installDir == ""
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "D:\EServer"
${endif}

# SetRegView 32 almost ...
!macroend

!macro customRemoveFiles
Expand All @@ -14,3 +21,9 @@
RMDir /r $INSTDIR
${endIf}
!macroend

!macro customUnWelcomePage
!define MUI_WELCOMEPAGE_TITLE "卸载本软件"
!define MUI_WELCOMEPAGE_TEXT "卸载本软件后会删除本软件的所有数据。请备份好重要数据!!!"
!insertmacro MUI_UNPAGE_WELCOME
!macroend

0 comments on commit b0e0091

Please sign in to comment.