From e0a77607f5455c4ce23b36f72cff9ec575f75877 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Wed, 8 Jul 2026 20:48:22 +0200 Subject: [PATCH] feat(tauri): migrate from GitLite to Gitty and clean up legacy data This commit updates the installer and configuration to transition from GitLite to Gitty. It includes macros for migrating legacy data and uninstalling the previous GitLite installation, ensuring a smoother upgrade experience for users. - Added migration and uninstallation macros for legacy GitLite data - Updated application identifier from com.git-lite to com.gitty - Enhanced post-installation cleanup for legacy shortcuts --- src-tauri/nsis-hooks.nsh | 47 +++++++++++++++++++++++++++++++++++---- src-tauri/tauri.conf.json | 2 +- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/src-tauri/nsis-hooks.nsh b/src-tauri/nsis-hooks.nsh index f085d6b..a26c398 100644 --- a/src-tauri/nsis-hooks.nsh +++ b/src-tauri/nsis-hooks.nsh @@ -1,11 +1,50 @@ -!macro NSIS_HOOK_POSTINSTALL +!macro GITTY_MIGRATE_LEGACY_DATA_DIR oldDir newDir + ${IfNot} ${FileExists} "${newDir}\*.*" + ${AndIf} ${FileExists} "${oldDir}\*.*" + CreateDirectory "${newDir}" + Rename "${oldDir}" "${newDir}" + ${EndIf} +!macroend + +!macro GITTY_UNINSTALL_LEGACY_GITLITE rootKey + ClearErrors + ReadRegStr $R0 ${rootKey} "Software\Microsoft\Windows\CurrentVersion\Uninstall\GitLite" "UninstallString" + ${If} "$R0" != "" + ReadRegStr $R1 ${rootKey} "Software\git-lite\GitLite" "" + ${If} "$R1" == "" + ReadRegStr $R1 ${rootKey} "Software\Microsoft\Windows\CurrentVersion\Uninstall\GitLite" "InstallLocation" + ${EndIf} + + DetailPrint "Removing legacy GitLite installation" + ${If} "$R1" != "" + ExecWait '$R0 /S _?=$R1' $R2 + ${Else} + ExecWait '$R0 /S' $R2 + ${EndIf} + ${EndIf} + + DeleteRegKey ${rootKey} "Software\Microsoft\Windows\CurrentVersion\Uninstall\GitLite" + DeleteRegKey ${rootKey} "Software\git-lite\GitLite" + DeleteRegKey /ifempty ${rootKey} "Software\git-lite" +!macroend + +!macro GITTY_CLEANUP_LEGACY_SHORTCUTS Delete "$DESKTOP\GitLite.lnk" Delete "$SMPROGRAMS\GitLite.lnk" RMDir /r "$SMPROGRAMS\GitLite" !macroend +!macro NSIS_HOOK_PREINSTALL + !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_UNINSTALL_LEGACY_GITLITE HKCU + !insertmacro GITTY_UNINSTALL_LEGACY_GITLITE HKLM +!macroend + +!macro NSIS_HOOK_POSTINSTALL + !insertmacro GITTY_CLEANUP_LEGACY_SHORTCUTS +!macroend + !macro NSIS_HOOK_POSTUNINSTALL - Delete "$DESKTOP\GitLite.lnk" - Delete "$SMPROGRAMS\GitLite.lnk" - RMDir /r "$SMPROGRAMS\GitLite" + !insertmacro GITTY_CLEANUP_LEGACY_SHORTCUTS !macroend diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0e4f340..d347ef6 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -2,7 +2,7 @@ "$schema": "https://schema.tauri.app/config/2", "productName": "Gitty", "version": "2026.7.16", - "identifier": "com.git-lite", + "identifier": "com.gitty", "build": { "beforeDevCommand": "npm run dev", "devUrl": "http://127.0.0.1:1420",