Hallo,
Ik ben bezig met een unattended XP install die kant en klaar is na de installatie.
Drivers gestalleerd, computername oke, reg. tweaks toegepast. etc.
Om dit te doen is het mogelijk om alles in de RunOnce te zetten, maar dit is wat lastig met het aanpassen als er iets veranderd.
Nu heb ik op internet het Windows Post Install programma gevonden. Het is mogelijk hier programmas in te zetten die dan automatisch geinstalleerd worden.
Nu wil ik dit dus via de RunOnce opstarten via een batchfile.
De source staat op de localdisk in de C:\HGIS.
Als ik via een batchfile dit programma open (met een HTA extentie) krijg ik de melding :
Could not save useroptions.js, en de melding could not save windowoptions.js.
Hoe kan ik zorgen dat ik via een script in de RUNONCE
deze code op kan starten zonder errors.
Ik ben bezig met een unattended XP install die kant en klaar is na de installatie.
Drivers gestalleerd, computername oke, reg. tweaks toegepast. etc.
Om dit te doen is het mogelijk om alles in de RunOnce te zetten, maar dit is wat lastig met het aanpassen als er iets veranderd.
Nu heb ik op internet het Windows Post Install programma gevonden. Het is mogelijk hier programmas in te zetten die dan automatisch geinstalleerd worden.
Nu wil ik dit dus via de RunOnce opstarten via een batchfile.
De source staat op de localdisk in de C:\HGIS.
Als ik via een batchfile dit programma open (met een HTA extentie) krijg ik de melding :
Could not save useroptions.js, en de melding could not save windowoptions.js.
Hoe kan ik zorgen dat ik via een script in de RUNONCE
code:
1
2
3
4
| ECHOOFF ECHO Starting WPI %systemdrive%\HGIS\WPI.hta |
deze code op kan starten zonder errors.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Windows Post-Install Wizard</title>
<meta HTTP-EQUIV="MSThemeCompatible" content="yes">
<script type="text/javascript" src="./WPIScripts/globals.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/windowoptions.js" application="yes">
</script>
<script type="text/javascript">
document.write('<HTA:APPLICATION ID="oWPI"' +
' application="yes"' +
' singleInstance="yes"' +
' navigable="yes"' +
' contextMenu="no"' +
' selection="no"' +
' scroll="no"' +
' scrollFlat="no"' +
' applicationName="Windows Post-Install Wizard"' +
' version="'+ShortVersion+'"' +
' icon="./Graphics/wpi.ico"' +
' border="'+(WindowShowBorder ? WindowBorderType : 'none')+'"' +
' borderStyle="'+WindowBorderStyle+'"' +
' innerBorder="'+(WindowInnerBorder ? 'yes' : 'no') +'"' +
' caption="'+(WindowCaption ? 'yes' : 'no') +'"' +
' sysMenu="'+(WindowSysMenu ? 'yes' : 'no') +'"' +
' minimizeButton="'+(WindowMinimizeButton ? 'yes' : 'no') +'"' +
' maximizeButton="'+(WindowMaximizeButton ? 'yes' : 'no') +'"' +
' windowState="'+WindowStartingState+'"'+
' showInTaskBar="'+(WindowShowInTaskBar ? 'yes' : 'no') +'"' +
' />');
</script>
<script type="text/javascript" src="./WPIScripts/registry_dos.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/core.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/api.js" application="yes">
</script>
<script type="text/javascript">
defaultWPI(); // Set the default paths
if (getOSver()=="XP")
{
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\CheckExeSignatures","no");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\RunInvalidSignatures","dword:00000001");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Associations\\LowRiskFileTypes",".js;.zip;.rar;.nfo;.txt;.exe;.bat;.com;.cmd;.reg;.msi;.hta;.htm;.html;.gif;.bmp;.jpg;.avi;.mpg;.mpeg;.mov;.mp3;.m3u;.wav;");
}
</script>
<script type="text/javascript">
var fullpath, regexpSearch, argLine, WPIcmdArgs;
fullpath = new String(unescape(document.location));
fullpath = fullpath.replace("file:///","").replace(/\//g,"\\\\").replace(/\$/g,"\\$");
regexpSearch = new RegExp('^"'+fullpath+'"',"i");
argLine = new String(oWPI.commandLine.replace(regexpSearch,''));
if (argLine)
{
var std = '\\S+|".+"'; //standard argument w/o Whitespace, or quoted (optionally prefixed)
var num = '\\d+'; //numeric argument
var Quoted = '"([a-z]:|\\.{1,2})(\\\\[^"*/:<>?\\\\|]+)+\\.js"'; //path to .js file, quoted
var NoWSpc = '([a-z]:|\\.{1,2})(\\\\[^ "*/:<>?\\\\|]+)+\\.js'; //path to .js file, no Whitespace
var optionsPattern = 'options=('+NoWSpc+'|'+Quoted+'|[^ "*/:<>?\\\\|]+\\.js)';
var configPattern = 'config=('+NoWSpc+'|'+Quoted+'|[^ "*/:<>?\\\\|]+\\.js)';
var checkOLPattern = 'check=('+std+')';
var timerPattern = 'timer=('+num+')';
cmdLinePattern = '^( +('+optionsPattern+'|'+configPattern+'|'+checkOLPattern+'|'+timerPattern+'|('+num+')|('+std+')))*$'; //any combination of the above, with spaces inbetween
regexpSearch = new RegExp(cmdLinePattern,"i");
WPIcmdArgs = argLine.match(regexpSearch);
if (WPIcmdArgs && WPIcmdArgs[3]) //We've got a match on a config .js file (if > 1 match, only the last one is recorded)
{
optionsFile = WPIcmdArgs[3];
if (optionsFile.substr(0, 1) == '"') //remove quotes if any
optionsFile = optionsFile.substring(1, optionsFile.length - 1);
if (optionsFile.indexOf('\\') == -1) //no path -> in WPIScripts
optionsFile=".\\WPIScripts\\"+optionsFile;
if (!FileExists(optionsFile)) //Is it valid?
optionsFile = '';
}
if (WPIcmdArgs && WPIcmdArgs[8]) //We've got a match on an option .js file (if > 1 match, only the last one is recorded)
{
configFile = WPIcmdArgs[8];
if (configFile.substr(0, 1) == '"') //remove quotes if any
configFile = configFile.substring(1, configFile.length - 1);
if (configFile.indexOf('\\') == -1) //no path -> in WPIScripts
configFile=".\\WPIScripts\\"+configFile;
if (!FileExists(configFile)) //Is it valid?
configFile = '';
}
if (WPIcmdArgs && WPIcmdArgs[13]) //We've got a match on a check on load option
{
checkOL = WPIcmdArgs[13];
if (checkOL.substr(0, 1) == '"') //remove quotes if any
checkOL = checkOL.substring(1, checkOL.length - 1);
}
if (WPIcmdArgs && WPIcmdArgs[14] && WPIcmdArgs[14] <= 3600) //We've got a match on a timer seconds option
timerSecs = WPIcmdArgs[14];
// For backwards compatibilty only. Will be removed in the future.
if (WPIcmdArgs && WPIcmdArgs[15] && WPIcmdArgs[15] <= 3600) //We've got a match on a number. This is for the timer.
timerSecs = WPIcmdArgs[15];
if (WPIcmdArgs && WPIcmdArgs[16]) //We've got a match on a generic argument. Give it to CheckOnLoad.
checkOL = WPIcmdArgs[16];
}
if (!FileExists(optionsFile)) //No argument or invalid file
{
try //have a look in the registry
{
optionsFile=WshShell.RegRead("HKEY_CURRENT_USER\\Software\\WPI\\OptionsFile");
}
catch(ex) //nothing up there
{ ; }
if (!FileExists(optionsFile)) //No reg key or invalid file
optionsFile = optionsDefault ; //... so let's take the default location
}
else
optionsFile = optionsFile.replace(/\\/g, '/');
windowFile=windowDefault; // maybe some day it will be an arg
if (!FileExists(configFile)) //Same goes for the config file
{
try
{
configFile=WshShell.RegRead("HKEY_CURRENT_USER\\Software\\WPI\\ConfigFile");
}
catch(ex)
{ ; }
if (!FileExists(configFile))
configFile = configDefault ;
}
else
configFile = configFile.replace(/\\/g, '/');
</script>
<script type="text/javascript">
var line=new String();
var num=1;
if (FileExists(optionsFile))
{
try
{
tf = fso.OpenTextFile(optionsFile, 1);
while (num==1 && !tf.AtEndOfStream)
{
line = tf.ReadLine();
if (line != "// WPI Options 5.0+")
{
alert("This 'useroptions.js' file is not a v5.0 compatible file.\n\nDelete the file and start WPI again.");
ExitWPI();
}
num++;
}
}
catch(ex)
{ ; }
finally
{
tf.Close();
}
}
</script>
<script type="text/javascript">
document.write('<script type="text/javascript" src="'+optionsFile+'" application="yes"></' + 'script>');
</script>
<script type="text/javascript">
if (CheckLanguageFile('en',"\\Lang\\lang_en.js") != '')
document.write('<script type="text/javascript" src="./Lang/lang_en.js" application="yes"></' + 'script>');
</script>
<script type="text/javascript">
if (Language=='zz')
Language=(navigator.language ? navigator.language : navigator.userLanguage).substr(0,2);
if (!FileExists(wpipath+"\\Lang\\lang_"+Language+".js"))
Language="en";
if (Language != 'en' && CheckLanguageFile(Language,"\\Lang\\lang_" + Language + ".js") != '')
document.write('<script type="text/javascript" src="./Lang/lang_'+Language+'.js" application="yes"></' + 'script>');
</script>
<script type="text/javascript">
try
{
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\Theme",Theme,"REG_SZ");
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\Language",Language,"REG_SZ");
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\PlayAudioInInstaller",PlayAudioInInstaller,"REG_SZ");
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\AudioVolume",Volume,"REG_SZ");
}
catch (ex)
{;}
</script>
<script type="text/javascript" src="./WPIScripts/reboot.js" application="yes">
</script>
<script type="text/javascript">
var msg="WPI has detected a previous installation that has not completed.\nWould you like to continue the installation?\nClick Ok to continue installation. Click Cancel to abort previous installation.";
try //Check for an interrupted install
{
ResumeInstall = WshShell.regRead("HKEY_CURRENT_USER\\Software\\WPI\\ResumeInstall");
}
catch (ex)
{
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\ResumeInstall",0,"REG_DWORD");
ResumeInstall=false;
}
ResumeInstall==1 ? ResumeInstall=true : ResumeInstall=false;
if (ResumeInstall)
{
if (confirm(msg)) //Prompt user to continue interrupted install
{
strFile=wpipath+"\\Common\\Installer.hta?RI=true&Theme=" + Theme + "&PAI=" + PlayAudioInInstaller;
WshShell.Run('mshta "'+strFile+'"',1,false); //Resume install
self.close();
}
else
{
ResumeInstall=false;
DeleteRebootFile();
try //Clean up registry
{
WshShell.regWrite("HKEY_CURRENT_USER\\Software\\WPI\\ResumeInstall",0,"REG_DWORD");
WshShell.regDelete("HKEY_CURRENT_USER\\Software\\WPI\\CurrentInstall");
WshShell.regDelete("HKEY_CURRENT_USER\\Software\\WPI\\LastExec");
WshShell.regDelete("HKEY_CURRENT_USER\\Software\\WPI\\LastTopLine");
}
catch (ex)
{;}
}
}
</script>
<script type="text/javascript">
var args="";
if (MonitorResolution != 0 || MonitorDepth != 0 || MonitorRefresh != 0)
{
strFile=wpipath+"\\Tools\\ResChange.exe";
if (FileExists(strFile))
{
if (MonitorResolution != 0)
{
switch(MonitorResolution)
{
case 800:
args += "-width=800 -height=600 ";
break;
case 1024:
args += "-width=1024 -height=768 ";
break;
case 1280:
args += "-width=1280 -height=1024 ";
break;
case 1600:
args += "-width=1600 -height=1200 ";
break;
}
}
if (MonitorDepth != 0)
{
args += "-depth=";
if (MonitorDepth==999)
args += "max ";
else
args += MonitorDepth+" ";
}
if (MonitorRefresh != 0)
{
args += "-refresh=";
if (MonitorRefresh==999)
args += "max";
else
args += MonitorRefresh;
}
args += " -quiet -force";
WshShell.Run('"'+strFile+'" '+args,0,true);
}
else
{
alert("'Tools\\ResChange.exe' does not exist.");
ExitWPI();
}
}
if (InstallFonts)
{
strFile=wpipath+"\\Tools\\Fonts\\FontInstaller.exe";
if (FileExists(strFile))
WshShell.Run('"'+strFile+'"',0,true);
else
{
alert("'Tools\\Fonts\\FontInstaller.exe' does not exist.");
ExitWPI();
}
}
</script>
<script type="text/javascript">
document.write('<script type="text/javascript" src="'+configFile+'" application="yes"></' + 'script>');
</script>
<script type="text/javascript">
if (checkOL)
CheckOnLoad=checkOL;
if (timerSecs)
{
Timer=true;
Seconds=timerSecs;
}
</script>
<script type="text/javascript">
document.write('<script type="text/javascript" src="./Themes/'+Theme+'/wpi_style.js" application="yes"></' + 'script>');
</script>
<script type="text/javascript" src="./WPIScripts/main.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/program.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/optionswizard.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/configwizard.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/installer.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/installer_log.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/boxes.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/check.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/timers.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/selecthandler.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/tips.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/dhtmlXCommon.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/dhtmlXTabbar.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/dhtmlXTree.js" application="yes">
</script>
<script type="text/javascript">
window.onerror = handleErrors; // or null to suppress error message
function handleErrors(msg, url, line)
{
var errorString = "JavaScript Error Report\n\n";
errorString += " Message: "+msg+"\n";
errorString += " Url: "+url+"\n";
errorString += " File: "+position+"\n";
errorString += "Function: "+whatfunc+"\n";
errorString += " Line: "+(line-1);
alert(errorString);
return true;
}
</script>
<script type="text/javascript">
if (!FileExists(optionsFile) && hdd != "")
SaveDefaultUserOptions();
if (!FileExists(windowFile) && hdd != "")
SaveDefaultWindowOptions();
if (!LoadThemedContent())
ExitWPI();
</script>
</head>
</html> |
[ Voor 5% gewijzigd door Verwijderd op 10-07-2008 08:49 ]