Author: remi
Date: 2008-11-28 11:23:31 +0100 (Fri, 28 Nov 2008)
New Revision: 2895
Modified:
software_suite_v2/software/http_server_resources/idle_behavior/trunk/installer.nsi
Log:
* updated the installer script according to the new Windows arch
Modified:
software_suite_v2/software/http_server_resources/idle_behavior/trunk/installer.nsi
===================================================================
---
software_suite_v2/software/http_server_resources/idle_behavior/trunk/installer.nsi
2008-11-28 10:23:12 UTC (rev 2894)
+++
software_suite_v2/software/http_server_resources/idle_behavior/trunk/installer.nsi
2008-11-28 10:23:31 UTC (rev 2895)
@@ -4,120 +4,59 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "IdleBehaviors"
-!define PRODUCT_VERSION "0.0.2"
+!define PRODUCT_VERSION "0.0.3"
-; Uninstaller name
-!define UNINSTALLER_EXE "uninstallIdleBehaviors.exe"
+; The files to write
+!define FINAL_INSTALLER_EXE "IdleBehaviorsInstaller_${PRODUCT_VERSION}.exe"
+!define UNINSTALLER_EXE "IdleBehaviorsUninstaller.exe"
; The name of the installer
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
; The file to write
-OutFile "${PRODUCT_NAME}_${PRODUCT_VERSION}.exe"
+OutFile "${FINAL_INSTALLER_EXE}"
; The default installation directory
-InstallDir c:\tuxdroid\bin\IdleBehavior
+InstallDir c:\
; Request application privileges for Windows Vista
RequestExecutionLevel admin
+; Get the Tuxdroid installation paths
+var /GLOBAL TUXDROID_PATH
+var /GLOBAL UNINSTALLERS_SUB_PATH
+
; -----------------------------------------------------------------------------
; Section ""
; -----------------------------------------------------------------------------
Section ""
- ; Check that the tuxhttpserver package found
- ReadRegStr $0 HKLM SOFTWARE\Tuxdroid\TuxHTTPServer "Install_Dir"
- StrCmp $0 "" endNoInstall
+ ; Get the Tuxdroid installation paths
+ ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tuxdroid\TuxdroidSetup"
"Install_Dir"
+ StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
; Copy the attitune files
- Call getUserPath
- CreateDirectory $R0\MyTux\MyTuxAttitunes\idleBehaviors
- SetOutPath $R0\MyTux\MyTuxAttitunes\idleBehaviors
- SetOverwrite ifnewer
+ CreateDirectory "$TUXDROID_PATH\resources\attitunes\idleBehaviors"
+ SetOutPath "$TUXDROID_PATH\resources\attitunes\idleBehaviors"
File /r att\*
; Copy the resource
- SetOutPath C:\tuxdroid\bin\tuxhttpserver\resources
- SetOverwrite ifnewer
+ SetOutPath "$TUXDROID_PATH\softwares\tuxhttpserver\resources"
File "ResourceTuxIdle.py"
- ; Write the installation path into the registry
- WriteRegStr HKLM SOFTWARE\Tuxdroid\${PRODUCT_NAME} "Install_Dir" "$INSTDIR"
-
- ; Write the uninstall file
- CreateDirectory $INSTDIR
- WriteUninstaller "${UNINSTALLER_EXE}"
-
- Return
-
- endNoInstall:
- MessageBox MB_OK "Aborded : Tux HTTP Server pakage not found."
+ ; Write the uninstaller file
+ WriteUninstaller "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
SectionEnd
; -----------------------------------------------------------------------------
; Section "Uninstall"
; -----------------------------------------------------------------------------
Section "Uninstall"
- ; Remove registry keys
- DeleteRegKey HKLM SOFTWARE\Tuxdroid\${PRODUCT_NAME}
+ ; Get the Tuxdroid installation paths
+ ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tuxdroid\TuxdroidSetup"
"Install_Dir"
+ StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
; Remove files and uninstaller
- Delete "C:\tuxdroid\bin\tuxhttpserver\resources\ResourceTuxIdle.py"
- Delete $INSTDIR\${UNINSTALLER_EXE}
-
- ; Restart the http server
- ExecDos::exec /NOUNLOAD /ASYNC /TIMEOUT=1000
"c:\tuxdroid\bin\tuxhttpserver_start.exe"
- Pop $0
- ExecDos::wait $0
+ Delete
"$TUXDROID_PATH\softwares\tuxhttpserver\resources\ResourceTuxIdle.py"
+ Delete "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
+ RMDir /r "$TUXDROID_PATH\resources\attitunes\idleBehaviors"
SectionEnd
-
-; -----------------------------------------------------------------------------
-; Post-installation/uninstallation
-; -----------------------------------------------------------------------------
-Function .onInstSuccess
- ; Restart the http server
- ExecDos::exec /NOUNLOAD /ASYNC /TIMEOUT=5000
"c:\tuxdroid\bin\tuxhttpserver_start.exe"
- Pop $0
- ExecDos::wait $0
-FunctionEnd
-
-; -----------------------------------------------------------------------------
-; Function to retrieve the user path
-; R0 : The returned path
-; -----------------------------------------------------------------------------
-Function RIndexOf
-Exch $R0
-Exch
-Exch $R1
-Push $R2
-Push $R3
-
- StrCpy $R3 $R0
- StrCpy $R0 0
- IntOp $R0 $R0 + 1
- StrCpy $R2 $R3 1 -$R0
- StrCmp $R2 "" +2
- StrCmp $R2 $R1 +2 -3
-
- StrCpy $R0 -1
-
-Pop $R3
-Pop $R2
-Pop $R1
-Exch $R0
-FunctionEnd
-
-!macro RIndexOf Var Str Char
-Push "${Char}"
-Push "${Str}"
- Call RIndexOf
-Pop "${Var}"
-!macroend
-!define RIndexOf "!insertmacro RIndexOf"
-
-Function getUserPath
- ${RIndexOf} $R0 "$DOCUMENTS" "\"
- StrLen $1 "$DOCUMENTS"
- IntOp $1 $1 - $R0
- StrCpy $R0 "$DOCUMENTS" $1
-FunctionEnd
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn