Jump to content

Problems with Reboot and Autoit Scripts


Recommended Posts

Hello,

Thank you for WPI! it's a great utility. Although I've been bashing my head for a couple of days trying to make it do something it probably wasn't quite meant for. I would like to use it to delpoy software on a bunch of machines. (Yes I know there are other solutions like RIS, Imaging, etc...) But I love the simplicity of software managment with WPI. And I'm sooooo close.

The problem I'm having is that I have a number of applications that I've written some very badly hacked Autoit scripts to install. The scripts work fine when launched with the desktop active (ie. just loading up wpa.hta and clicking on begin install). But when wpi gives a reboot command, the next time it starts is during runonceex, before the desktop is loaded. At that point my autoit scripts just hang - which looks like a timing issues that I haven't been able to resolve.

What I would like to do is have wpi restart after reboot from the administrators startup folder. That way the full desktop would be loaded and my misbehaving autoit scritps would likely install properly. I realize there are other ways to package silent installs but I find that autoit is just fast for what we are doing. (Installing Autodesk maya for instance)

What I tried was removing the reg.write commands for runonceex that launch WPI on reboot. I modified the installer.js and commented out the two lines responsible for writing the runonceex code.

Then on reboot I've tried to restart WPI with the same command line that runonceex was using %wpipath%\wpi\common\installer.hta

But I get errors every time it tries to restart - the wpi dialog comes up but usually it's blank and typically followed by a script error or two.

Does anyone have any suggestions on how I might proceed? How I might change the reboot process to run from a full desktop rather than at runonceex?

Thank you in advance for any help.

BTW. I'm using an Nlite disk that installs xp unattneded then maps the z: drive to a network share and runs wpi. WPI works fine run manually from the network share.

Link to comment
Share on other sites


Just for reference in case anyone else is trying to use WPI the way I was, here is what I found:

1) WPI seems to not like network shares to run from. The interface runs fine in configuration mode. But the installer.js seems to have a few problems.

When trying to reboot and continue installing... I constantly received errors - always error in line xxx. Object Expected. I'm assuming (although I have very little programming background)

that a drive letter on a network is treated as a different kind of object than a physical drive (like the CD-Rom). As long as WPI doesn't have to reboot it runs fine from the Network until the very end.

2) With regards to Autoit and the full desktop: The installer.js contains the commands to write registry entries for rebooting. I had success with chaning the reboot/reinstall from runonceex to runonce. I also had success just disabling the reg keys altogether and having wpi run from the startup folder at boot time. WPI conveniently asks if you want to continue with the previous install. It would have been easy to disable the continue button so it would continue automatically but WPI kept crashing because of #1.

3) I did find out that if WPI resides locally on the C: drive but all the installation programs run on the network that I had less problems. Since this isn't the option that I was looking for I skipped trying to figure out the errors.

4) Slipstreaming dmx's Internet Explorer 7 with Nlite sets the intranet zone to medium secuirty and gives a dialogue box "The publisher cannot be verified" click ok. I was able to get around that by setting the intranet zone to low security from cmdlines.txt on my nlite created cd by adding:

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1" /v "Flags" /t REG_DWORD /d 219 /f

I will say that WPI is very cool. If and when I need to make a boot DVD I will likely use it. In the meantime I've just gone back to the boring old command window and batch scripts. Not pretty but it's working well. After seeing this project I'm half tempted to write an autoit script with a pretty point and click on the scripts I want to run.

Link to comment
Share on other sites

Hey, thanks for the tip. Actually I did know the autoit scripts can be compiled since I have half of the ones I use already done that way. just hadn't thought about it in this context. Sometimes you need someone else to point you in the right direction.

I will continue following the development of WPI since I think it's has great potential for mutilple configuration/ system managers like myself.

Cheers,

Craig

Link to comment
Share on other sites

  • 2 weeks later...

I have a similar problem, though I'm sure I can work around it... I use autoit scripts to do silent installs and if I use them on a computer they work fine. However if I use them with WPI for some reason it gets the path wrong. For instance I have firefox script compiled as a exe, and to avoid clutter I put the actually firefox install exe in a subdirectory. If I execute the compiled script firefox install flawlessly, however if I use WPI to execute it, it executes the script but then the script errors and says it can't find the firefox install exe.. What i will probably do is recompile the script without using the subdirectory... But i was just wondering if anyone had any ideas on this other then that. Thanks

Link to comment
Share on other sites

Definitely sounds like and error in your autoIt script. You will definitely need to re-compile it. I would suggest using relative paths instead of absolute paths, then you won't have to re-compile again in the future.

edit: After thinking about it more, I'm not sure that this will solve your problem. I have an idea that it may be something else, but I need you to post your folder structure and the part of your autoIt script you are using to call the install file to be sure.

Edited by zorphnog
Link to comment
Share on other sites

My structure is WPI\Install\exe Install has the compiled scripts... Exe has the setup files. I've tried running WPI from the hard drive and from a ISO... Not that that would make too much difference. Oh and one other thing, it doesn't have problems with all the programs I use AutoIt for just some. The one i remember that doesn't work is Adobe Reader 8.2..

;Adobe 8.2
Run ( "exe\AdbeRdr80_en_US.exe" )
WinWaitActive ( "Adobe Reader 8 - Setup" , "Destination Folder" )
ControlClick ( "Adobe Reader 8 - Setup", "", "[CLASS:Button; INSTANCE:1]" )
;Click install to begin
WinWaitActive ( "Adobe Reader 8 - Setup" , "Ready" )
ControlClick ( "Adobe Reader 8 - Setup", "", "[CLASS:Button; INSTANCE:1]" )

WinWaitActive ( "Adobe Reader 8 - Setup" , "Setup Completed" )
ControlClick ( "Adobe Reader 8 - Setup", "", "[CLASS:Button; INSTANCE:2]" )
ControlClick ( "Adobe Reader 8 - Setup", "", "[CLASS:Button; INSTANCE:1]" )

Link to comment
Share on other sites

Ok, this is what I think is happening. WPI runs from the WPI folder and since the call to your AutoIt script is made from WPI the base directory is WPI. Basically, WPI runs your AutoIt script from a command prompt where the root is your WPI path. So when your AutoIt script tries to access exe its really trying the path: WPI\exe\AdbeRdr80_en_US.exe instead of WPI\Install\exe\AdbeRdr80_en_US.exe.

I'm not completely sure that is what is happening, but you can easily verify by changing the Run command of your AutoIt script to ("Install\exe\AdbeRdr80_en_US.exe").

Link to comment
Share on other sites

Ok, this is what I think is happening. WPI runs from the WPI folder and since the call to your AutoIt script is made from WPI the base directory is WPI. Basically, WPI runs your AutoIt script from a command prompt where the root is your WPI path. So when your AutoIt script tries to access exe its really trying the path: WPI\exe\AdbeRdr80_en_US.exe instead of WPI\Install\exe\AdbeRdr80_en_US.exe.

I'm not completely sure that is what is happening, but you can easily verify by changing the Run command of your AutoIt script to ("Install\exe\AdbeRdr80_en_US.exe").

Okay... Acutally that sounds about right and makes complete sense... But if that is the case I might as well just change it to be in the same folder.. I just didn't want to have to have to versions of those. One for WPI and one for individual installs... But then I could use WPI for all individual installs. I'll have to run that by the rest of IT...

Thanks for the quick response.

Link to comment
Share on other sites

Hello,

I have a similar problem with WPI and reboot. For testing purposes, I choosed a very simple configuration:

Config.js:

===========

pn=1;

prog[pn]=['MS Office 2003 SP2'];

uid[pn]=['MS Office 2003 SP2'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['cmd'];

cmd2[pn]=['%reboot%'];

pn++;

prog[pn]=['MS Office 2003 SP2'];

uid[pn]=['MS Office 2003 SP2'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['cmd'];

=================

It works well until the end, when instead of finishing and exiting, I am getting the following error:

=================

An error has occured on this script page

Line: 462

Char: 2

Error: Object expected

Code: 0

URL: file://C:\WPI\Common\Installer.hta

Do you want to continue runnung scripts on this page?

Yes No

=================

No matter what I choose the program freezes and I have to use Task Manager to kill the process.

Also, no script file is mentioned to look for that line and object that is expected.

Can anybody help me?

Thank you,

Liviu

Link to comment
Share on other sites

You have two configuration entries named the same thing? Did you create your config file manually? Try using the configuration editor within WPI. You should never have two entries with the same unique ID, nor should they have spaces in the IDs.

Link to comment
Share on other sites

Hello,

I don't think this is important. The same config.js works fine without reboot. I needed to add the reboot because I am doing some changes to the registry to allow me to autologon as administrator. After I install what I need I have to change back the registry, login as a regular user and finish.

A short version of the config.js will look like this:

================

prog[pn]=['Autologon'];

uid[pn]=['Autologon'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['C:\\Installs\\AutoLogon.exe'];

cmd2[pn]=['%reboot% 10'];

pn++;

prog[pn]=['PCAnywhere'];

uid[pn]=['PCAnywhere'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['cmd /C c: && cd C:\\Installs\\MultiSet\\ && multiset.exe C:\\Installs\\MultiSet\\Categories\\Office\\PCAnywhereHost.mst -silent && exit'];

pn++;

prog[pn]=['Icons'];

uid[pn]=['Icons'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['C:\\Installs\\Icons.bat'];

cmd2[pn]=['%reboot% 2'];

pn++;

prog[pn]=['Final'];

uid[pn]=['Final'];

dflt[pn]=['yes'];

cat[pn]=['System'];

forc[pn]=['no'];

cmd1[pn]=['C:\\Installs\\Final.bat'];

pn++;

===================

As you probable immagine, the autologon.exe makes the changes for the auto administrator login, then I install PCAnywhere, then Icons.bat deletes the registry entries.

As I said before, if I am logged in as administrator from the beginning, do what I need, and leave the administrator logged in, everything works fine.

Thank you again,

Liviu

Link to comment
Share on other sites

So what kind of errors are you running into? I understand what you are trying to do, but I'm not sure exactly what problem you are having. Does it just not load? Do you receive an error message? Does it not logon? Does WPI freeze?

Just to make sure I understand you correctly, you're logging in as a user originally, run you're autologon utility, reboot, auto logon as admin, install PCAnywhere, delete registry entries, reboot, and try to log back into the user account and run final.bat?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...