File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,24 @@ Section "Install" SecMain
6363 DetailPrint " Checking for 64 bit uninstaller"
6464 SetRegView 64
6565 ReadRegStr $R0 HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" " UninstallString"
66- StrCmp $R0 " " doInstall doUninstall
66+ StrCmp $R0 " " doInstall checkUninstaller
67+
68+ checkUninstaller:
69+ ; Remove quotes from uninstaller path to check if file exists
70+ StrCpy $R1 $R0 " " 1 ; Skip first quote
71+ StrLen $R2 $R1
72+ IntOp $R2 $R2 - 1 ; Remove last quote
73+ StrCpy $R1 $R1 $R2
74+
75+ DetailPrint " Checking if uninstaller exists: $R1"
76+ IfFileExists " $R1" doUninstall cleanupOrphanedRegistry
77+
78+ cleanupOrphanedRegistry:
79+ DetailPrint " Previous uninstaller not found, cleaning up orphaned registry keys..."
80+ SetRegView 64
81+ DeleteRegKey HKLM " SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
82+ DeleteRegKey HKLM " SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\${EXENAME}.exe"
83+ Goto doInstall
6784
6885doUninstall:
6986 DetailPrint " Uninstalling previous version..."
You can’t perform that action at this time.
0 commit comments