summaryrefslogtreecommitdiff
path: root/distribution/win32/nsis/uninstall.nsh
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
commit7b358424ebad9349421acd533c2fa1cbf6cf3e3e (patch)
tree686678532eefed525c242fd214d0cfb2914726c5 /distribution/win32/nsis/uninstall.nsh
Initial import of xtrkcad version 1:4.0.2-2
Diffstat (limited to 'distribution/win32/nsis/uninstall.nsh')
-rw-r--r--distribution/win32/nsis/uninstall.nsh30
1 files changed, 30 insertions, 0 deletions
diff --git a/distribution/win32/nsis/uninstall.nsh b/distribution/win32/nsis/uninstall.nsh
new file mode 100644
index 0000000..b568e21
--- /dev/null
+++ b/distribution/win32/nsis/uninstall.nsh
@@ -0,0 +1,30 @@
+;
+; additional uninstaller instructions
+;
+
+; Remove file association
+ !define Index "Line${__LINE__}"
+ ReadRegStr $1 HKCR ".xtc" ""
+ StrCmp $1 "XTrackCAD.Design" 0 "${Index}-NoOwn" ; only do this if we own it
+ ReadRegStr $1 HKCR ".xtc" "backup_val"
+ StrCmp $1 "" 0 "${Index}-Restore" ; if backup="" then delete the whole key
+ DeleteRegKey HKCR ".xtc"
+ Goto "${Index}-NoOwn"
+ "${Index}-Restore:"
+ WriteRegStr HKCR ".xtc" "" $1
+ DeleteRegValue HKCR ".xtc" "backup_val"
+
+ DeleteRegKey HKCR "XTrackCAD.Design" ;Delete key with association settings
+
+ System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
+ "${Index}-NoOwn:"
+ !undef Index
+
+; Remove shortcuts, if any
+; SetShellVarContext all
+
+!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
+
+Delete "$SMPROGRAMS\$MUI_TEMP\XTrkCad Help.lnk"
+Delete "$SMPROGRAMS\$MUI_TEMP\XTrkCad ReadMe.lnk"
+ \ No newline at end of file