summaryrefslogtreecommitdiff
path: root/nasm.nsi
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-07-15 23:10:46 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2011-07-15 23:13:26 +0400
commit98de3349499d7222091588afc32f420ce0af36a1 (patch)
tree81d5804b94e1f067c38327a531bb0bdc42f5b49f /nasm.nsi
parentee42e62c7ca23e94ffd6161254e4fb7b4932db07 (diff)
downloadnasm-98de3349499d7222091588afc32f420ce0af36a1.tar.gz
nasm-98de3349499d7222091588afc32f420ce0af36a1.tar.bz2
nasm-98de3349499d7222091588afc32f420ce0af36a1.zip
nsis: Remove desktop bat link as well
In case of installation procedure being used in a per-user fasion the display link to a bat file remain untouched at uninstallation time. Fix it. I hope this time all things go smooth. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nasm.nsi')
-rw-r--r--nasm.nsi20
1 files changed, 17 insertions, 3 deletions
diff --git a/nasm.nsi b/nasm.nsi
index bcab04f..7daea6c 100644
--- a/nasm.nsi
+++ b/nasm.nsi
@@ -106,6 +106,7 @@ Section "NASM" SecNasm
;Store shortcuts folder
WriteRegStr HKCU "Software\${PRODUCT_SHORT_NAME}\" "lnk" $SMPROGRAMS\$StartMenuFolder
+ WriteRegStr HKCU "Software\${PRODUCT_SHORT_NAME}\" "bat-lnk" $DESKTOP\${PRODUCT_SHORT_NAME}.lnk
;
; the bat we need
@@ -190,9 +191,22 @@ Section "Uninstall"
rm_instdir_true:
RMDir /r /rebootok "$INSTDIR"
rm_instdir_false:
+
;
- ; Links
- Delete /rebootok "$DESKTOP\${PRODUCT_SHORT_NAME}.lnk"
+ ; Desktop link
+ ReadRegStr $0 HKCU Software\${PRODUCT_SHORT_NAME} "bat-lnk"
+ StrCmp $0 0 +1 +3
+ MessageBox MB_OK "Invalid path to a bat-lnk file, aborting"
+ Abort
+ IfFileExists $0 +3 +1
+ MessageBox MB_OK "No bat-lnk files found, aborting."
+ Abort
+ MessageBox MB_YESNO "The following file will be deleted$\n$0" IDYES rm_batlinks_true IDNO rm_batlinks_false
+ rm_batlinks_true:
+ Delete /rebootok "$0"
+ RMDir "$0"
+ rm_batlinks_false:
+
;
; Start menu folder
ReadRegStr $0 HKCU Software\${PRODUCT_SHORT_NAME} "lnk"
@@ -207,7 +221,7 @@ Section "Uninstall"
Delete /rebootok "$0\*"
RMDir "$0"
rm_links_false:
- DeleteRegKey /ifempty HKCU "Software\${PRODUCT_SHORT_NAME}"
+ DeleteRegKey /ifempty HKCU "Software\${PRODUCT_SHORT_NAME}"
SectionEnd
;