Skip to content

Commit 447205a

Browse files
committed
Update Windows install script
Look for Inkscape in Program Files, and then in Program Files (x86) if not found. Give error if Inkscape not found at all.
1 parent a185069 commit 447205a

File tree

1 file changed

+47
-13
lines changed

1 file changed

+47
-13
lines changed

packaging/win/installscript.nsi

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@
1818
; --------------------------------
1919

2020
; The name of the installer
21-
Name "EggBot v2.4.0"
21+
Name "EggBot v2.5.0"
2222

2323
; The file to write
24-
OutFile "EggBot_240A.exe"
24+
OutFile "EggBot_250A.exe"
2525

2626
; The default installation directory
27-
InstallDir $PROGRAMFILES\Inkscape
27+
InstallDir $PROGRAMFILES64\Inkscape
28+
;InstallDir $PROGRAMFILES\Inkscape
29+
30+
31+
32+
33+
34+
35+
36+
2837

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

3443
; Directory dialog text header::
3544
DirText "The Eggbot software needs to be installed within \
36-
Inkscape, in the extensions folder. \
45+
Inkscape 0.91 (or newer), in the extensions folder. \
3746
$\r$\r \
3847
If you have installed Inkscape normally (in 'Program files'), simply \
3948
click 'Install' below. \
4049
If your copy of Inkscape is elsewhere, please select the Inkscape directory below. \
41-
$\r$\r \
4250
If you have not yet installed Inkscape, please download it from http://inkscape.org before \
43-
proceeding."
51+
proceeding. "
52+
53+
54+
ComponentText "Check the components you want to install and uncheck \
55+
the components that you don't want to install. Click Install to \
56+
begin. This installer requires Inkscape 0.91 (or newer)."
4457

4558

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

5871
!insertmacro MUI_PAGE_COMPONENTS
59-
!insertmacro MUI_PAGE_DIRECTORY
72+
;!insertmacro MUI_PAGE_DIRECTORY
6073
!insertmacro MUI_PAGE_INSTFILES
6174

6275
;!insertmacro MUI_UNPAGE_CONFIRM
@@ -75,21 +88,42 @@ proceeding."
7588

7689
Section "Inkscape Extensions" SecMain
7790

91+
Var /GLOBAL InkscapeDir
92+
93+
${If} ${FileExists} `$PROGRAMFILES64\Inkscape\AUTHORS`
94+
95+
; Inkscape found in 64-bit program files directory
96+
;InstallDir $PROGRAMFILES64\Inkscape
97+
StrCpy $InkscapeDir "$PROGRAMFILES64\Inkscape"
98+
99+
${ElseIf} ${FileExists} `$PROGRAMFILES\Inkscape\AUTHORS`
100+
101+
; file is a file
102+
; InstallDir $PROGRAMFILES\Inkscape
103+
StrCpy $InkscapeDir "$PROGRAMFILES\Inkscape"
104+
${Else}
105+
106+
; file is neither a file or a directory (i.e. it doesn't exist)
107+
Abort "Inkscape not found. Please install Inkscape 0.91 (or newer) and try again."
108+
109+
${EndIf}
110+
111+
78112
; Set output path to the installation directory.
79-
SetOutPath "$INSTDIR\share\extensions"
113+
SetOutPath "$InkscapeDir\share\extensions"
80114

81115
; Put file there
82116
File /r extensions\serial*
83117
File extensions\*
84118

85-
SetOutPath "$INSTDIR\share\templates"
119+
SetOutPath "$InkscapeDir\share\templates"
86120
File templates\*
87121

88122
SectionEnd ; end the section
89123

90124

91125
Section "USB Driver" SecDriver
92-
SetOutPath "$INSTDIR\Driver"
126+
SetOutPath "$InkscapeDir\Driver"
93127

94128
File "EBB_inf\mchpcdc.cat"
95129
File "EBB_inf\mchpcdc.inf"
@@ -98,19 +132,19 @@ Section "USB Driver" SecDriver
98132
File "EBB_inf\ReadMe.txt"
99133
File "EBB_inf\USBDriverInstaller.exe"
100134

101-
ExecWait '"$INSTDIR\Driver\USBDriverInstaller.exe" -auto'
135+
ExecWait '"$InkscapeDir\Driver\USBDriverInstaller.exe" -auto'
102136
SectionEnd
103137

104138
Section "EggBot Examples" SecExamples
105139

106140
; Set output path to the installation directory.
107-
SetOutPath "$INSTDIR"
141+
SetOutPath "$InkscapeDir"
108142

109143
; Put directory there
110144
File /r "EggBot Examples"
111145

112146
; Desktop Shortcut!
113-
createShortCut "$DESKTOP\EggBot Examples.lnk" "$INSTDIR\EggBot Examples"
147+
createShortCut "$DESKTOP\EggBot Examples.lnk" "$InkscapeDir\EggBot Examples"
114148

115149
SectionEnd ; end the section
116150

0 commit comments

Comments
 (0)