@@ -58,18 +58,12 @@ Name: "{autodesktop}\FORCE Examples"; Filename: "{app}\examples"; Tasks: desktop
58
58
59
59
[Registry]
60
60
; File association for .heron files
61
- Root : HKCU; Subkey : " Software\Classes\.heron" ; ValueType : string ; ValueName : " " ; ValueData : " FORCE.heron" ; Flags : uninsdeletevalue
62
- Root : HKCU; Subkey : " Software\Classes\FORCE.heron" ; ValueType : string ; ValueName : " " ; ValueData : " HERON File" ; Flags : uninsdeletekey
63
- Root : HKCU; Subkey : " Software\Classes\FORCE.heron\DefaultIcon" ; ValueType : string ; ValueData : " {app} \heron.exe,0"
61
+ Root : HKCU; Subkey : " Software\Classes\.heron" ; ValueType : string ; ValueName : " " ; ValueData : " FORCE.heron" ; Flags : uninsdeletevalue ; Check : WizardIsTaskSelected( ' workbenchinstall ' )
62
+ Root : HKCU; Subkey : " Software\Classes\FORCE.heron" ; ValueType : string ; ValueName : " " ; ValueData : " HERON File" ; Flags : uninsdeletekey ; Check : WizardIsTaskSelected( ' workbenchinstall ' )
63
+ Root : HKCU; Subkey : " Software\Classes\FORCE.heron\DefaultIcon" ; ValueType : string ; ValueData : " {app} \heron.exe,0" ; Check : WizardIsTaskSelected( ' workbenchinstall ' )
64
64
; The open command will be set dynamically in the [Code] section
65
65
66
- ;[Run]
67
- ;Filename: "{app}\Workbench-5.4.1.exe"; Description: "Install NEAMS Workbench-5.4.1"; Flags: nowait postinstall skipifsilent
68
-
69
66
[Code]
70
- var
71
- WorkbenchPath: string;
72
-
73
67
procedure InitializeProgressBar ();
74
68
begin
75
69
WizardForm.ProgressGauge.Style := npbstMarquee;
@@ -84,50 +78,17 @@ begin
84
78
WizardForm.StatusLabel.Caption := ' Installing NEAMS Workbench-5.4.1...' ;
85
79
86
80
try
87
- Exec(ExpandConstant(' {app}\Workbench-5.4.1.exe' ), ExpandConstant(' /S /D={autopf}\Workbench-5.4.1\' ), ' ' , SW_HIDE , ewWaitUntilTerminated, ResultCode);
81
+ Exec(ExpandConstant(' {app}\Workbench-5.4.1.exe' ), ExpandConstant(' /S /D={autopf}\Workbench-5.4.1\' ), ' ' , SW_SHOW , ewWaitUntilTerminated, ResultCode);
88
82
finally
89
83
WizardForm.ProgressGauge.Visible := False;
90
84
WizardForm.ProgressGauge.Style := npbstNormal;
91
85
WizardForm.StatusLabel.Caption := ' ' ;
92
86
end ;
93
87
end ;
94
88
95
- function FindWorkbenchInstallPath (): string;
96
- var
97
- Paths: array of string;
98
- Path: string;
99
- I: Integer;
100
- begin
101
- Result := ' ' ;
102
- // Workbench should be installed in {autopf} alongside the FORCE installation, but we'll also check
103
- // other common locations for the Workbench executable just in case it hasn't been found there.
104
- Paths := [
105
- ExpandConstant(' {autopf}' ),
106
- ExpandConstant(' {app}' ),
107
- ExpandConstant(' {%USERPROFILE}' ),
108
- ExpandConstant(' {userpf}' ),
109
- ExpandConstant(' {userprograms}' ),
110
- ExpandConstant(' {commonpf}' ),
111
- ExpandConstant(' {commonpf64}' ),
112
- ExpandConstant(' {commonpf32}' ),
113
- ExpandConstant(' {commonprograms}' ),
114
- ExpandConstant(' {sd}' )
115
- ];
116
- for I := 0 to GetArrayLength(Paths) - 1 do
117
- begin
118
- Path := Paths[I];
119
- // MsgBox('Checking for Workbench at path ' + Path + '\Workbench-5.4.1\bin\Workbench.exe', mbInformation, MB_OK);
120
- if FileExists(Path + ' \Workbench-5.4.1\bin\Workbench.exe' ) then
121
- begin
122
- Result := Path + ' \Workbench-5.4.1\' ;
123
- // MsgBox('Found workbench at path ' + Result + '!', mbInformation, MB_OK);
124
- break;
125
- end ;
126
- end ;
127
- end ;
128
-
129
89
procedure CurStepChanged (CurStep: TSetupStep);
130
90
var
91
+ WorkbenchPath: string;
131
92
DefaultAppsFilePath: string;
132
93
DefaultAppsContent: string;
133
94
ResultCode: Integer;
@@ -139,7 +100,7 @@ begin
139
100
RunWorkbenchInstaller();
140
101
141
102
// Find the path to the Workbench executable
142
- WorkbenchPath := FindWorkbenchInstallPath( );
103
+ WorkbenchPath := ExpandConstant( ' {autopf}\Workbench-5.4.1\ ' );
143
104
144
105
// Associate .heron files with the Workbench executable
145
106
RegWriteStringValue(HKEY_CURRENT_USER, ' Software\Classes\FORCE.heron\shell\open\command' , ' ' , ' "' + WorkbenchPath + ' bin\Workbench.exe' + ' " "%1"' );
@@ -168,16 +129,9 @@ begin
168
129
end ;
169
130
170
131
// Save the path to the Workbench executable in a file at {app}/.workbench.
171
- if not SaveStringToFile(ExpandConstant(' {app}' ) + ' \.workbench' , ' WORKBENCHDIR=' + WorkbenchPath, False) then
172
- begin
173
- MsgBox(' Failed to save the path to the Workbench executable. Attempted to write to ' + ExpandConstant(' {app}' ) + ' \.workbench' , mbError, MB_OK);
174
- end ;
175
- end
176
- else
177
- begin
178
- if CurStep = ssPostInstall then
132
+ if not SaveStringToFile(ExpandConstant(' {app}\.workbench' ), ' WORKBENCHDIR=' + WorkbenchPath, False) then
179
133
begin
180
- MsgBox(' Workbench not installed. Not creating Workbench defaults. WorkbenchPath = ' + WorkbenchPath, mbInformation , MB_OK);
134
+ MsgBox(' Failed to save the path to the Workbench executable. Attempted to write to ' + ExpandConstant( ' {app}\.workbench ' ), mbError , MB_OK);
181
135
end ;
182
136
end ;
183
137
end ;
0 commit comments