Pages: [1]   Go Down
Author Topic: Updated Windows Installer  (Read 425 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I updated the NSIS Windows install script (described at http://arduino.cc/forum/index.php/topic,37572.0.html) for 0022. No big changes, but I added a starting Device Manager to install the driver.

Enjoy,
Eric

Code:
!include "MUI2.nsh"

!define MUI_ABORTWARNING

;SetCompressor /SOLID /FINAL lzma

Name "Arduino 0022" ; Installer Name

RequestExecutionLevel highest ; Hope that the user is an admin and can install stuff

OutFile "arduino-0022_installer.exe" ; Installer file name

; Set default installation directory, or look for a previous installation
;InstallDir $PROGRAMFILES\arduino
InstallDir C:\Arduino\arduino-0022
InstallDirRegKey HKCU "Software\arduino" ""

; Order the installation wizard pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

; Order the uninstallation wizard pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

; Installer language
!insertmacro MUI_LANGUAGE "English"

Section ;"Required"

; Backup the hardware folder since people may have custom files in there (this is for upgrading)
;CreateDirectory $INSTDIR\0017_backup_hardware
;CopyFiles /SILENT $INSTDIR\hardware\*.*  $INSTDIR\0017_backup_hardware

; Copy all files
SetOutPath $INSTDIR
File /r arduino-0022\*.*

; Generate uninstaller, see Uninstall section
WriteUninstaller $INSTDIR\uninstaller.exe

; Write information for Windows Add/Remove Software
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\arduino" "DisplayName" "Arduino"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\arduino" "UninstallString" "$\"$INSTDIR\uninstaller.exe$\""
WriteRegStr HKCU "Software\arduino" "" $INSTDIR

SectionEnd

Section "Desktop Shortcut" SecDesktopShortcut

SetOutPath $DESKTOP
CreateShortCut $DESKTOP\Arduino.lnk $INSTDIR\arduino.exe

SectionEnd

Section "Start Menu Entry" SecStartMenu

SetOutPath $STARTMENU\Arduino
CreateShortCut $STARTMENU\Arduino\Arduino.lnk $INSTDIR\arduino.exe
CreateShortCut $STARTMENU\Arduino\Uninstall.lnk $INSTDIR\uninstaller.exe

SectionEnd

Section "Device Manager" SecDeviceManager

ExecShell "open" $SYSDIR\devmgmt.msc

SectionEnd

; Describe the sections here
LangString DESC_DesktopShortcut ${LANG_ENGLISH} "A shortcut to Arduino on your desktop"
LangString DESC_StartMenu ${LANG_ENGLISH} "A shortcut to Arduino on in your start menu"
LangString DESC_DeviceManager ${LANG_ENGLISH} "Run Device Manager to Install Driver"

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortcut} $(DESC_DesktopShortcut)
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_StartMenu)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDeviceManager} $(DESC_DeviceManager)
!insertmacro MUI_FUNCTION_DESCRIPTION_END

Section "Uninstall" ; Uninstaller actions

; Remove installation completely
Delete $INSTDIR\*.*
RMDir /r $INSTDIR

; Remove created shortcuts
Delete $STARTMENU\Arduino\Arduino.lnk
RMDir /r $STARTMENU\Arduino
Delete $DESKTOP\Arduino.lnk

; Remove from Windows's Add/Remove Programs
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\arduino"

SectionEnd
 

Logged

Pages: [1]   Go Up
Jump to: