feat(installer): enhance installation process with registry and shortcuts
This update improves the installation process by adding macros for registering the application in the Windows registry and creating shortcuts on the desktop and start menu. These changes ensure a better user experience by providing easy access to the application and proper installation records. - Register application details in the Windows registry - Create shortcuts for quick access on the desktop and start menu - Clean up legacy shortcuts during installation
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
!macro GITTY_MIGRATE_LEGACY_DATA_DIR oldDir newDir
|
!macro GITTY_MIGRATE_LEGACY_DATA_DIR oldDir newDir
|
||||||
${IfNot} ${FileExists} "${newDir}\*.*"
|
${IfNot} ${FileExists} "${newDir}\*.*"
|
||||||
${AndIf} ${FileExists} "${oldDir}\*.*"
|
${AndIf} ${FileExists} "${oldDir}\*.*"
|
||||||
CreateDirectory "${newDir}"
|
|
||||||
Rename "${oldDir}" "${newDir}"
|
Rename "${oldDir}" "${newDir}"
|
||||||
${EndIf}
|
${EndIf}
|
||||||
!macroend
|
!macroend
|
||||||
@@ -34,6 +33,26 @@
|
|||||||
RMDir /r "$SMPROGRAMS\GitLite"
|
RMDir /r "$SMPROGRAMS\GitLite"
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
|
!macro GITTY_REGISTER_INSTALL
|
||||||
|
WriteRegStr HKCU "${MANUPRODUCTKEY}" "" "$INSTDIR"
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "MainBinaryName" "${MAINBINARYNAME}.exe"
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "DisplayName" "${PRODUCTNAME}"
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "DisplayIcon" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\""
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "DisplayVersion" "${VERSION}"
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "Publisher" "${MANUFACTURER}"
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "InstallLocation" "$\"$INSTDIR$\""
|
||||||
|
WriteRegStr HKCU "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||||
|
WriteRegDWORD HKCU "${UNINSTKEY}" "NoModify" "1"
|
||||||
|
WriteRegDWORD HKCU "${UNINSTKEY}" "NoRepair" "1"
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!macro GITTY_CREATE_UPDATE_SHORTCUTS
|
||||||
|
CreateShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
||||||
|
!insertmacro SetLnkAppUserModelId "$SMPROGRAMS\${PRODUCTNAME}.lnk"
|
||||||
|
CreateShortcut "$DESKTOP\${PRODUCTNAME}.lnk" "$INSTDIR\${MAINBINARYNAME}.exe"
|
||||||
|
!insertmacro SetLnkAppUserModelId "$DESKTOP\${PRODUCTNAME}.lnk"
|
||||||
|
!macroend
|
||||||
|
|
||||||
!macro NSIS_HOOK_PREINSTALL
|
!macro NSIS_HOOK_PREINSTALL
|
||||||
!insertmacro GITTY_MIGRATE_LEGACY_DATA_DIR "$APPDATA\com.git-lite" "$APPDATA\com.gitty"
|
!insertmacro GITTY_MIGRATE_LEGACY_DATA_DIR "$APPDATA\com.git-lite" "$APPDATA\com.gitty"
|
||||||
!insertmacro GITTY_MIGRATE_LEGACY_DATA_DIR "$LOCALAPPDATA\com.git-lite" "$LOCALAPPDATA\com.gitty"
|
!insertmacro GITTY_MIGRATE_LEGACY_DATA_DIR "$LOCALAPPDATA\com.git-lite" "$LOCALAPPDATA\com.gitty"
|
||||||
@@ -43,6 +62,8 @@
|
|||||||
|
|
||||||
!macro NSIS_HOOK_POSTINSTALL
|
!macro NSIS_HOOK_POSTINSTALL
|
||||||
!insertmacro GITTY_CLEANUP_LEGACY_SHORTCUTS
|
!insertmacro GITTY_CLEANUP_LEGACY_SHORTCUTS
|
||||||
|
!insertmacro GITTY_REGISTER_INSTALL
|
||||||
|
!insertmacro GITTY_CREATE_UPDATE_SHORTCUTS
|
||||||
!macroend
|
!macroend
|
||||||
|
|
||||||
!macro NSIS_HOOK_POSTUNINSTALL
|
!macro NSIS_HOOK_POSTUNINSTALL
|
||||||
|
|||||||
Reference in New Issue
Block a user