Author: remi
Date: 2008-11-30 12:32:54 +0100 (Sun, 30 Nov 2008)
New Revision: 2933

Modified:
   software_suite_v2/tuxware/tuxdroidflasher/trunk/installer.nsi
Log:
* updated installer with relative paths

Modified: software_suite_v2/tuxware/tuxdroidflasher/trunk/installer.nsi
===================================================================
--- software_suite_v2/tuxware/tuxdroidflasher/trunk/installer.nsi       
2008-11-30 11:23:07 UTC (rev 2932)
+++ software_suite_v2/tuxware/tuxdroidflasher/trunk/installer.nsi       
2008-11-30 11:32:54 UTC (rev 2933)
@@ -1,66 +1,70 @@
 ; installer.nsi
-; This installer which install the misc function
+; This installer which install Tuxdroid flasher
 ; -----------------------------------------------------------------------------
 
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "TuxdroidFlasher"
 !define PRODUCT_VERSION "0.0.1"
 
+; The files to write
+!define FINAL_INSTALLER_EXE "TuxdroidFlasherInstaller_${PRODUCT_VERSION}.exe"
+!define UNINSTALLER_EXE "TuxdroidFlasherUninstaller.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\tuxdroidflasher
+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 tuxisalive package
-    ReadRegStr $0 HKLM SOFTWARE\Tuxdroid\tuxupFW "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"
        
-       CreateDirectory $INSTDIR
-       CreateDirectory $INSTDIR\locale
-       CreateDirectory $INSTDIR\Skins
+    CreateDirectory "$TUXDROID_PATH\softwares\tuxdroidflasher"
+       CreateDirectory "$TUXDROID_PATH\softwares\tuxdroidflasher\locale"
+       CreateDirectory "$TUXDROID_PATH\softwares\tuxdroidflasher\Skins"
                
        copy_binaries:
-               SetOutPath $INSTDIR
+               SetOutPath "$TUXDROID_PATH\softwares\tuxdroidflasher"
                File "flasher\TuxdroidFlasher.exe"
                File "tools\dongle_hid_check.exe"
                File "tools\tuxup.exe"
-               SetOutPath $INSTDIR\locale
+               SetOutPath "$TUXDROID_PATH\softwares\tuxdroidflasher\locale"
                File /r flasher\locale\*
-               SetOutPath $INSTDIR\Skins
+               SetOutPath "$TUXDROID_PATH\softwares\tuxdroidflasher\Skins"
                File /r flasher\Skins\*
        
        ; Write the shortcut
        CreateDirectory "$SMPROGRAMS\Tuxdroid\Firmware updater"
-    CreateShortCut "$SMPROGRAMS\Tuxdroid\Firmware updater\Tuxdroid 
programmer.lnk" "C:\tuxdroid\bin\tuxdroidflasher\TuxdroidFlasher.exe" "" "" 0
+    CreateShortCut "$SMPROGRAMS\Tuxdroid\Firmware updater\Tuxdroid 
programmer.lnk" "$TUXDROID_PATH\softwares\tuxdroidflasher\TuxdroidFlasher.exe" 
"" "" 0
     
        ; Write the uninstall file
-    WriteUninstaller "$INSTDIR\uninstall.exe"
-       Return
-       
-       endNoInstall:
-        MessageBox MB_OK "Aborded : Tuxup and firmware installation not found."
-        Quit
-
+    WriteUninstaller "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
 SectionEnd
 
 ; -----------------------------------------------------------------------------
 ; Section "Uninstall"
 ; -----------------------------------------------------------------------------
 Section "Uninstall"
+    ; Get the Tuxdroid installation paths
+    ReadRegStr $TUXDROID_PATH HKLM "SOFTWARE\Tuxdroid\TuxdroidSetup" 
"Install_Dir"
+    StrCpy $UNINSTALLERS_SUB_PATH "$TUXDROID_PATH\uninstallers\sub"
+    
        Delete "$SMPROGRAMS\Tuxdroid\Firmware updater\Tuxdroid programmer.lnk"
-       Delete $INSTDIR\uninstall.exe
-       RMDir /r $INSTDIR
-       RMDir $INSTDIR
+       Delete "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
+       RMDir /r "$TUXDROID_PATH\softwares\tuxdroidflasher"
 SectionEnd


-------------------------------------------------------------------------
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

Reply via email to