Author: remi
Date: 2008-11-30 12:17:39 +0100 (Sun, 30 Nov 2008)
New Revision: 2931

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

Modified: software_suite_v2/tuxware/fuxusbflasher/trunk/installer.nsi
===================================================================
--- software_suite_v2/tuxware/fuxusbflasher/trunk/installer.nsi 2008-11-30 
11:13:09 UTC (rev 2930)
+++ software_suite_v2/tuxware/fuxusbflasher/trunk/installer.nsi 2008-11-30 
11:17:39 UTC (rev 2931)
@@ -1,36 +1,43 @@
 ; installer.nsi
-; This installer which install the misc function
+; This installer which install the Tux Fux flasher
 ; -----------------------------------------------------------------------------
 
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "FuxUSBFlasher"
-!define PRODUCT_VERSION "0.0.1"
+!define PRODUCT_VERSION "0.1.1"
 
+; The files to write
+!define FINAL_INSTALLER_EXE "FuxUSBFlasherInstaller_${PRODUCT_VERSION}.exe"
+!define UNINSTALLER_EXE "FuxUSBFlasherUninstaller.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\fuxusbflasher
+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\driver
-       CreateDirectory $INSTDIR\locale
-       CreateDirectory $INSTDIR\Skins
+       CreateDirectory "$TUXDROID_PATH\softwares\fuxusbflasher"
+       CreateDirectory "$TUXDROID_PATH\softwares\fuxusbflasher\driver"
+       CreateDirectory "$TUXDROID_PATH\softwares\fuxusbflasher\locale"
+       CreateDirectory "$TUXDROID_PATH\softwares\fuxusbflasher\Skins"
                
     System::Call "kernel32::GetCurrentProcess() i .s"
     System::Call "kernel32::IsWow64Process(i s, *i .r0)"
@@ -43,7 +50,7 @@
         File "drivers\x86\libusb0.dll"
         SetOutPath $WINDIR\inf
         File "drivers\x86\atmel_usb_dfu.inf"
-               SetOutPath $INSTDIR\driver
+               SetOutPath "$TUXDROID_PATH\softwares\fuxusbflasher\driver"
                File "drivers\x86\libusb0.sys"
                File "drivers\x86\libusb0.dll"
                File "drivers\x86\atmel_usb_dfu.inf"
@@ -51,7 +58,7 @@
         Goto copy_binaries
 
     is64bit: ;AMD64
-        SetOutPath $INSTDIR\driver
+        SetOutPath "$TUXDROID_PATH\softwares\fuxusbflasher\driver"
         File "drivers\x64\ptlibusb0.sys"
         File "drivers\x64\ptlibusb0_x64.sys"
         File "drivers\x64\ptlibusb0.dll"
@@ -65,7 +72,7 @@
         Goto copy_binaries
                
        copy_binaries:
-               SetOutPath $INSTDIR
+               SetOutPath "$TUXDROID_PATH\softwares\fuxusbflasher"
                File "flasher\FuxUSBFlasher.exe"
                File "flasher\FuxUSBFlasher.exe.manifest"
                File "tools\dongle_hid_checker\dongle_hid_check.exe"
@@ -73,31 +80,28 @@
                File "tools\uninstall_hid_dongle\uninstall_hid_dongle.exe"
                File "tools\dfu_programmer\dfu-programmer.exe"
                File "tools\tuxup\tuxup.exe"
-               SetOutPath $INSTDIR\locale
+               SetOutPath "$TUXDROID_PATH\softwares\fuxusbflasher\locale"
                File /r flasher\locale\*
-               SetOutPath $INSTDIR\Skins
+               SetOutPath "$TUXDROID_PATH\softwares\fuxusbflasher\Skins"
                File /r flasher\Skins\*
        
        ; Write the shortcut
        CreateDirectory "$SMPROGRAMS\Tuxdroid\Firmware updater"
-    CreateShortCut "$SMPROGRAMS\Tuxdroid\Firmware updater\Dongle 
programmer.lnk" "C:\tuxdroid\bin\fuxusbflasher\FuxUSBFlasher.exe" "" "" 0
+    CreateShortCut "$SMPROGRAMS\Tuxdroid\Firmware updater\Dongle 
programmer.lnk" "$TUXDROID_PATH\softwares\fuxusbflasher\FuxUSBFlasher.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"
-       Delete "$SMPROGRAMS\Tuxdroid\Firmware updater\Fux programmer.lnk"
-       Delete $INSTDIR\uninstall.exe
-       RMDir /r $INSTDIR
-       RMDir $INSTDIR
+    ; 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\Dongle programmer.lnk"
+       Delete "$UNINSTALLERS_SUB_PATH\${UNINSTALLER_EXE}"
+       RMDir /r "$TUXDROID_PATH\softwares\fuxusbflasher"
 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