SF.net SVN: geany:[3255] trunk/geany.nsi
eht16 at users.sourceforge.net
eht16 at xxxxx
Wed Nov 19 18:03:32 UTC 2008
Revision: 3255
http://geany.svn.sourceforge.net/geany/?rev=3255&view=rev
Author: eht16
Date: 2008-11-19 18:03:32 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Properly support silent installations with the Windows installer (closes #2204671).
Modified Paths:
--------------
trunk/geany.nsi
Modified: trunk/geany.nsi
===================================================================
--- trunk/geany.nsi 2008-11-19 17:32:24 UTC (rev 3254)
+++ trunk/geany.nsi 2008-11-19 18:03:32 UTC (rev 3255)
@@ -20,7 +20,11 @@
!define RESOURCEDIR "geany-${PRODUCT_VERSION}"
SetCompressor /SOLID lzma
+
XPStyle on
+; set execution level for Windows Vista
+RequestExecutionLevel user
+
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
InstallDir "$PROGRAMFILES\Geany"
@@ -51,23 +55,33 @@
; Init code ;
;;;;;;;;;;;;;;;;
Function .onInit
+ SetShellVarContext all
+
; prevent running multiple instances of the installer
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "geany_installer") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
- MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
+ MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running." /SD IDOK
Abort
; warn about a new install over an existing installation
ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
- "Geany has already been installed. $\nDo you want to remove the previous version before installing $(^Name) ?" \
- IDNO done
+ "Geany has already been installed. $\nDo you want to remove the previous version before installing $(^Name) ?" \
+ /SD IDYES IDYES remove IDNO done
+ remove:
;Run the uninstaller
ClearErrors
- ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+ IfSilent dosilent nonsilent
+ dosilent:
+ ;TODO read $INSTDIR from registry, the instdir of the old installation might be different
+ ; from the new one (command line arg /D=...)
+ ExecWait '$R0 /S _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
+ Goto done
+ nonsilent:
+ ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
done:
FunctionEnd
@@ -258,11 +272,11 @@
;;;;;;;;;;;;;;;;;;;;;
Function un.onUninstSuccess
HideWindow
- MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
+ MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK
FunctionEnd
Function un.onInit
- MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
+ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" /SD IDYES IDYES +2
Abort
FunctionEnd
@@ -276,7 +290,7 @@
notPossible:
RMDir "$INSTDIR" ; removes folder if empty
- MessageBox MB_OK "The given directory is not writeable. Please choose another one!"
+ MessageBox MB_OK "The given directory is not writeable. Please choose another one!" /SD IDOK
Abort
possible:
FileClose $0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list