-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e17750
commit 99839a4
Showing
3 changed files
with
27 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,41 @@ | ||
!macro NSIS_HOOK_POSTINSTALL | ||
; Check if theseus_gui.exe exists | ||
${IfFileExists} "$LOCALAPPDATA\Modrinth App\theseus_gui.exe" | ||
SetShellVarContext current | ||
|
||
Delete "$LOCALAPPDATA\Modrinth App\theseus_gui.exe" | ||
IfFileExists "$LOCALAPPDATA${PRODUCTNAME}\theseus_gui.exe" file_found file_not_found | ||
file_found: | ||
Delete "$LOCALAPPDATA${PRODUCTNAME}\theseus_gui.exe" | ||
|
||
{{#each file_associations as |association| ~}} | ||
{{#each association.ext as |ext| ~}} | ||
!insertmacro APP_UNASSOCIATE "{{ext}}" "{{or association.name ext}}" | ||
{{/each}} | ||
{{/each}} | ||
|
||
{{#each deep_link_protocols as |protocol| ~}} | ||
ReadRegStr $R7 SHCTX "Software\Classes\\{{protocol}}\shell\open\command" "" | ||
${If} $R7 == "$\"$LOCALAPPDATA\Modrinth App\theseus_gui.exe$\" $\"%1$\"" | ||
DeleteRegKey SHCTX "Software\Classes\\{{protocol}}" | ||
${EndIf} | ||
{{/each}} | ||
|
||
Delete "$LOCALAPPDATA\Modrinth App\uninstall.exe" | ||
RMDir "$LOCALAPPDATA\Modrinth App" | ||
Delete "$LOCALAPPDATA${PRODUCTNAME}\uninstall.exe" | ||
RMDir "$LOCALAPPDATA${PRODUCTNAME}" | ||
|
||
!insertmacro DeleteAppUserModelId | ||
|
||
; Remove start menu shortcut | ||
!insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder | ||
!insertmacro IsShortcutTarget "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" "$LOCALAPPDATA\Modrinth App\theseus_gui.exe" | ||
!insertmacro IsShortcutTarget "$SMPROGRAMS$AppStartMenuFolder${PRODUCTNAME}.lnk" "$LOCALAPPDATA${PRODUCTNAME}\theseus_gui.exe" | ||
Pop $0 | ||
${If} $0 = 1 | ||
!insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" | ||
Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" | ||
RMDir "$SMPROGRAMS\$AppStartMenuFolder" | ||
!insertmacro UnpinShortcut "$SMPROGRAMS$AppStartMenuFolder${PRODUCTNAME}.lnk" | ||
Delete "$SMPROGRAMS$AppStartMenuFolder${PRODUCTNAME}.lnk" | ||
RMDir "$SMPROGRAMS$AppStartMenuFolder" | ||
${EndIf} | ||
!insertmacro IsShortcutTarget "$SMPROGRAMS\${PRODUCTNAME}.lnk" "$LOCALAPPDATA\Modrinth App\theseus_gui.exe" | ||
!insertmacro IsShortcutTarget "$SMPROGRAMS${PRODUCTNAME}.lnk" "$LOCALAPPDATA${PRODUCTNAME}\theseus_gui.exe" | ||
Pop $0 | ||
${If} $0 = 1 | ||
!insertmacro UnpinShortcut "$SMPROGRAMS\${PRODUCTNAME}.lnk" | ||
Delete "$SMPROGRAMS\${PRODUCTNAME}.lnk" | ||
!insertmacro UnpinShortcut "$SMPROGRAMS${PRODUCTNAME}.lnk" | ||
Delete "$SMPROGRAMS${PRODUCTNAME}.lnk" | ||
${EndIf} | ||
|
||
; Remove desktop shortcuts | ||
!insertmacro IsShortcutTarget "$DESKTOP\${PRODUCTNAME}.lnk" "$LOCALAPPDATA\Modrinth App\theseus_gui.exe" | ||
!insertmacro IsShortcutTarget "$DESKTOP${PRODUCTNAME}.lnk" "$LOCALAPPDATA${PRODUCTNAME}\theseus_gui.exe" | ||
Pop $0 | ||
${If} $0 = 1 | ||
!insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk" | ||
Delete "$DESKTOP\${PRODUCTNAME}.lnk" | ||
!insertmacro UnpinShortcut "$DESKTOP${PRODUCTNAME}.lnk" | ||
Delete "$DESKTOP${PRODUCTNAME}.lnk" | ||
${EndIf} | ||
|
||
DeleteRegKey HKCU "${UNINSTKEY}" | ||
|
||
${EndIfFileExists} ; End of file existence check | ||
|
||
goto end_of_test ;<== important for not continuing on the else branch | ||
file_not_found: | ||
end_of_test: | ||
!macroend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters