Add an unistaller and Registry entries.

The software can now uninstall itself and will show up in Add or Remove software.
This commit is contained in:
efrick 2024-08-07 14:44:21 -04:00
parent 065df71090
commit af2f15fd40

View File

@ -36,5 +36,21 @@ SectionGroup "PDF-Merge" pdf_merge_inst
Delete "$INSTDIR\PDF-Merge.zip" Delete "$INSTDIR\PDF-Merge.zip"
nsExec::ExecToStack 'icacls "$INSTDIR" /grant Everyone:F /T' nsExec::ExecToStack 'icacls "$INSTDIR" /grant Everyone:F /T'
CreateShortCut "$DESKTOP\PDF-Merge.lnk" "${APP_EXE}" CreateShortCut "$DESKTOP\PDF-Merge.lnk" "${APP_EXE}"
File "PDF-Merge Icon.ico"
; Write the registry keys to add the program to the Installed Programs list
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "InstallDate" 0x00000000
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayName" "PDF-Merge"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayVersion" "$Current_Version"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "Publisher" "$Company_Name"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "UninstallString" '"$INSTDIR\uninst.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\" "DisplayIcon" '"$INSTDIR\PDF-Merge Icon.ico"'
WriteUninstaller "uninst.exe"
SectionEnd SectionEnd
SectionGroupEnd SectionGroupEnd
Section "Uninstall"
Delete "$DESKTOP\PDF-Merge.lnk"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PDF-Merge\"
RMDir /r "$INSTDIR"
SectionEnd