Skip to content

Commit

Permalink
Update Windows install script
Browse files Browse the repository at this point in the history
Look for Inkscape in Program Files, and then in Program Files (x86) if
not found. Give error if Inkscape not found at all.
  • Loading branch information
oskay committed Jan 31, 2015
1 parent a185069 commit 447205a
Showing 1 changed file with 47 additions and 13 deletions.
60 changes: 47 additions & 13 deletions packaging/win/installscript.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
; --------------------------------

; The name of the installer
Name "EggBot v2.4.0"
Name "EggBot v2.5.0"

; The file to write
OutFile "EggBot_240A.exe"
OutFile "EggBot_250A.exe"

; The default installation directory
InstallDir $PROGRAMFILES\Inkscape
InstallDir $PROGRAMFILES64\Inkscape
;InstallDir $PROGRAMFILES\Inkscape









; Request application privileges for Windows Vista
RequestExecutionLevel admin
Expand All @@ -33,14 +42,18 @@ BrandingText "The Original EggBot, by Evil Mad Scientist Laboratories"

; Directory dialog text header::
DirText "The Eggbot software needs to be installed within \
Inkscape, in the extensions folder. \
Inkscape 0.91 (or newer), in the extensions folder. \
$\r$\r \
If you have installed Inkscape normally (in 'Program files'), simply \
click 'Install' below. \
If your copy of Inkscape is elsewhere, please select the Inkscape directory below. \
$\r$\r \
If you have not yet installed Inkscape, please download it from http://inkscape.org before \
proceeding."
proceeding. "


ComponentText "Check the components you want to install and uncheck \
the components that you don't want to install. Click Install to \
begin. This installer requires Inkscape 0.91 (or newer)."


!define MUI_ICON "icon\eggbotlogo_2014_256px.ico"
Expand All @@ -56,7 +69,7 @@ proceeding."
;Page instfiles

!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

;!insertmacro MUI_UNPAGE_CONFIRM
Expand All @@ -75,21 +88,42 @@ proceeding."

Section "Inkscape Extensions" SecMain

Var /GLOBAL InkscapeDir

${If} ${FileExists} `$PROGRAMFILES64\Inkscape\AUTHORS`

; Inkscape found in 64-bit program files directory
;InstallDir $PROGRAMFILES64\Inkscape
StrCpy $InkscapeDir "$PROGRAMFILES64\Inkscape"

${ElseIf} ${FileExists} `$PROGRAMFILES\Inkscape\AUTHORS`

; file is a file
; InstallDir $PROGRAMFILES\Inkscape
StrCpy $InkscapeDir "$PROGRAMFILES\Inkscape"
${Else}

; file is neither a file or a directory (i.e. it doesn't exist)
Abort "Inkscape not found. Please install Inkscape 0.91 (or newer) and try again."

${EndIf}


; Set output path to the installation directory.
SetOutPath "$INSTDIR\share\extensions"
SetOutPath "$InkscapeDir\share\extensions"

; Put file there
File /r extensions\serial*
File extensions\*

SetOutPath "$INSTDIR\share\templates"
SetOutPath "$InkscapeDir\share\templates"
File templates\*

SectionEnd ; end the section


Section "USB Driver" SecDriver
SetOutPath "$INSTDIR\Driver"
SetOutPath "$InkscapeDir\Driver"

File "EBB_inf\mchpcdc.cat"
File "EBB_inf\mchpcdc.inf"
Expand All @@ -98,19 +132,19 @@ Section "USB Driver" SecDriver
File "EBB_inf\ReadMe.txt"
File "EBB_inf\USBDriverInstaller.exe"

ExecWait '"$INSTDIR\Driver\USBDriverInstaller.exe" -auto'
ExecWait '"$InkscapeDir\Driver\USBDriverInstaller.exe" -auto'
SectionEnd

Section "EggBot Examples" SecExamples

; Set output path to the installation directory.
SetOutPath "$INSTDIR"
SetOutPath "$InkscapeDir"

; Put directory there
File /r "EggBot Examples"

; Desktop Shortcut!
createShortCut "$DESKTOP\EggBot Examples.lnk" "$INSTDIR\EggBot Examples"
createShortCut "$DESKTOP\EggBot Examples.lnk" "$InkscapeDir\EggBot Examples"

SectionEnd ; end the section

Expand Down

0 comments on commit 447205a

Please sign in to comment.