Commit 467bee5f32bbbe6df2a450eab8fd1230860dfbbb

Authored by ghollingworth
1 parent f77c0c94

Change some naming to be more generic and use files in place

win32/install_script.nsi
... ... @@ -9,14 +9,14 @@
9 9 ;General
10 10  
11 11 ;Name and file
12   - Name "Compute Module Boot Tool"
13   - OutFile "ComputeModuleBoot.exe"
  12 + Name "Raspberry Pi USB boot"
  13 + OutFile "rpiboot_setup.exe"
14 14  
15 15 ;Default installation folder
16   - InstallDir "$PROGRAMFILES\Compute Module Boot"
  16 + InstallDir "$PROGRAMFILES\Raspberry Pi"
17 17  
18 18 ;Get installation folder from registry if available
19   - InstallDirRegKey HKCU "Software\Compute Module Boot" ""
  19 + InstallDirRegKey HKCU "Software\Raspberry Pi" ""
20 20  
21 21 ;Request application privileges for Windows Vista
22 22 RequestExecutionLevel admin
... ... @@ -52,14 +52,49 @@
52 52 !insertmacro MUI_LANGUAGE "English"
53 53  
54 54 ;--------------------------------
  55 +; Initialisation functions
  56 +Function .onInit
  57 +
  58 + ReadRegStr $R0 HKCU "Software\Compute Module Boot" ""
  59 + StrCmp $R0 "" done
  60 +
  61 + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
  62 + "'Compute Module Boot' is already installed. $\n$\nClick `OK` to remove the \
  63 + previous version or `Cancel` to cancel this upgrade." \
  64 + IDOK uninst
  65 + Abort
  66 +
  67 +;Run the uninstaller
  68 +uninst:
  69 + ClearErrors
  70 +
  71 + ; Remove the left over usb_driver directory
  72 + RmDir /r /REBOOTOK $R0\usb_driver
  73 +
  74 + ExecWait '$R0\Uninstall.exe _?=$R0'
  75 +
  76 + IfErrors no_remove_uninstaller done
  77 + ;You can either use Delete /REBOOTOK in the uninstaller or add some code
  78 + ;here to remove the uninstaller. Use a registry key to check
  79 + ;whether the user has chosen to uninstall. If you are using an uninstaller
  80 + ;components page, make sure all sections are uninstalled.
  81 + no_remove_uninstaller:
  82 +
  83 +done:
  84 +
  85 + RmDir /r /REBOOTOK $R0
  86 +
  87 +FunctionEnd
  88 +
  89 +;--------------------------------
55 90 ;Installer Sections
56 91  
57   -Section "Compute Module Boot" SecCmBoot
  92 +Section "Raspberry Pi USB Boot" Sec_rpiboot
58 93  
59 94 SetOutPath "$INSTDIR"
60 95  
61 96 File /r redist
62   - File /r msd
  97 + File /r ..\msd
63 98  
64 99 DetailPrint "Installing BCM2708 driver..."
65 100 ExecWait '"$INSTDIR\redist\wdi-simple.exe" -v 0x0a5c -p 0x2763 -t 0' $0
... ... @@ -72,14 +107,14 @@ Section "Compute Module Boot" SecCmBoot
72 107 File cyggcc_s-1.dll
73 108 File cygusb-1.0.dll
74 109 File cygwin1.dll
75   - File rpiboot.exe
  110 + File ..\rpiboot.exe
76 111  
77   - CreateDirectory $SMPROGRAMS\ComputeModuleBoot
78   - CreateShortcut "$SMPROGRAMS\ComputeModuleBoot\RPi Boot.lnk" "$INSTDIR\rpiboot.exe"
79   - CreateShortcut "$SMPROGRAMS\ComputeModuleBoot\Uninstall RPi Boot.lnk" "$INSTDIR\Uninstall.exe"
  112 + CreateDirectory "$SMPROGRAMS\Raspberry Pi"
  113 + CreateShortcut "$SMPROGRAMS\Raspberry Pi\rpiboot.lnk" "$INSTDIR\rpiboot.exe"
  114 + CreateShortcut "$SMPROGRAMS\Raspberry Pi\Uninstall rpiboot.lnk" "$INSTDIR\Uninstall.exe"
80 115  
81 116 ;Store installation folder
82   - WriteRegStr HKCU "Software\Compute Module Boot" "" $INSTDIR
  117 + WriteRegStr HKCU "Software\Raspberry Pi" "" $INSTDIR
83 118  
84 119 ;Create uninstaller
85 120 WriteUninstaller "$INSTDIR\Uninstall.exe"
... ... @@ -94,7 +129,7 @@ SectionEnd
94 129  
95 130 ;Assign language strings to sections
96 131 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
97   - !insertmacro MUI_DESCRIPTION_TEXT ${SecCmBoot} $(DESC_SecDummy)
  132 + !insertmacro MUI_DESCRIPTION_TEXT ${Sec_rpiboot} $(DESC_SecDummy)
98 133 !insertmacro MUI_FUNCTION_DESCRIPTION_END
99 134  
100 135 ;--------------------------------
... ... @@ -104,6 +139,7 @@ Section "Uninstall"
104 139  
105 140 RmDir /r /REBOOTOK $INSTDIR\redist
106 141 RmDir /r /REBOOTOK $INSTDIR\msd
  142 + RmDir /r /REBOOTOK $INSTDIR\usb_driver
107 143  
108 144 Delete $INSTDIR\Uninstall.exe
109 145 Delete $INSTDIR\cyggcc_s-1.dll
... ... @@ -113,8 +149,8 @@ Section "Uninstall"
113 149  
114 150 RmDir /REBOOTOK $INSTDIR
115 151  
116   - RmDir /r "$SMPROGRAMS\ComputeModuleBoot"
  152 + RmDir /r "$SMPROGRAMS\Raspberry Pi"
117 153  
118   - DeleteRegKey /ifempty HKCU "Software\Compute Module Boot"
  154 + DeleteRegKey /ifempty HKCU "Software\Raspberry Pi"
119 155  
120 156 SectionEnd
... ...
win32/msd/bootcode.bin deleted
No preview for this file type
win32/msd/start.elf deleted
No preview for this file type
win32/rpiboot.exe deleted
No preview for this file type
win32/ComputeModuleBoot.exe renamed to win32/rpiboot_setup.exe 100644 → 100755
No preview for this file type