Jump to content

Runonceex problem


Recommended Posts

Please bare with me as this is hard to explain, so it may be a little confusing.

Im have been using the windows post install wizard found here: http://www.msfn.org/board/index.php?showtopic=11491&st=30 to install some apps.

I recently used BuckeyeXPs office shrink to shrink down office here: http://www.msfn.org/board/index.php?showtopic=16709

I then RAR'd the office files to a sfx file, to shrink it more.

I was able to install office correctly if I installed it manually from the cmd window, but when I try to install unattended office2003 with the post install wizard which uses

runeonceex it never finishes the install before it goes to the next ronceonceex command, which happens to be a clean up command so it deletes all the office install files

before office install is complete.

Here is a snip of the code

// note: strpath is the temp directory

//Install Microsoft Office
if (document.inner.WPI.chkbox023.checked){
var CDROM = WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath");
WshShell.regWrite(KeyBase + "\\125\\", "Installing Microsoft Office", "REG_SZ");
WshShell.regWrite(KeyBase + "\\125\\1", CDROM + "\\install\\Office2003\\Office2003.exe", "REG_SZ");
WshShell.regWrite(KeyBase + "\\125\\2", strPath + "\setup.exe TRANSFORMS=Unattended.MST /qb-", "REG_SZ");
 }

 
//Cleanup the Temp directory
WshShell.regWrite(KeyBase + "\\150\\", "Cleaning Up Temp Files", "REG_SZ");
WshShell.regWrite(KeyBase + "\\150\\1", "cmd.exe /c RD /s /q " + strPath, "REG_SZ");

I do know it does unzip the files to the temp directory but it moves to the cleanup process and deletes the files before it installs. I initally had the sfx run the install command but it also never completed, which is why I added the install command seperately as shown in the code above.

I thought all processes had to complete before it moved to the next process.... Does anyone know why its moving to the next one before the current one is completed?

thanks

TWILL

Link to comment
Share on other sites


Where does it extract the files? Not sure it runs the installer, but I would assume you would extract it to a directory, which would be strPath. Since I don't see where that is declared, I would assume something like c:\install. Check your not extracting to c:\install\office2003\, because then your setup wouldn't work. If it isn't working, then it would skip that command, and go on to the next one, which is why cleanup is going.

Link to comment
Share on other sites

Thanks for the replies

@[bM]Crusher -- yes it looks a little bad but actually its not much different than the other way everone is writing to the runonceex. Special thanks to Whimsy and AirMaleDFW for helping me with understanding the code, I definitely wouldnt have figured it out all by myself.

Here is a comparison if anyone is interested, they both write to the runonceex:

the unattended install way

REG ADD %KEY%\001 /VE /D "Preparing Installation..." /f

REG ADD %KEY%\001 /V 1 /D "%systemdrive%\apps\prepare.cmd" /f

var CDROM = WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath");

WshShell.regWrite(KeyBase + "\\001\\", "Preparing Installation...", "REG_SZ");

WshShell.regWrite(KeyBase + "\\001\\1", CDROM + "\\apps\\prepare.cmd", "REG_SZ"); //prepare cmd is being run from CD instead of systemdrive

@sleepnmojo

Yes the directory it expands to is strPath = c:\temp. Once it unzips, it does begin to install but during the install it goes to the cleanup which deletes strPath or c:\temp.

I can get it to work if I dont zip the files and just install from the regular files. So it must be somthing to do with unzipping that runonceex doesnt like.

thanks again for the replies!! :)

TWILL

Link to comment
Share on other sites

@Alanoll - I checked for that and the archive is not deleting the files. Good thought though.

I did however, find a fix, I had to add another line to the runonceex

from this:
//Install Microsoft Office
if (document.inner.WPI.chkbox023.checked){
var CDROM = WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath");
WshShell.regWrite(KeyBase + "\\125\\", "Installing Microsoft Office", "REG_SZ");
WshShell.regWrite(KeyBase + "\\125\\1", CDROM + "\\install\\Office2003\\Office2003.exe", "REG_SZ");
WshShell.regWrite(KeyBase + "\\125\\2", strPath + "\setup.exe TRANSFORMS=Unattended.MST /qb-", "REG_SZ");
}

to this:
//Install Microsoft Office
if (document.inner.WPI.chkbox023.checked){
var CDROM = WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Setup\\SourcePath");
WshShell.regWrite(KeyBase + "\\125\\", "Installing Microsoft Office", "REG_SZ");
WshShell.regWrite(KeyBase + "\\125\\1", CDROM + "\\install\\Office2003\\Office2003.exe", "REG_SZ");
WshShell.regWrite(KeyBase + "\\130\\1", strPath + "\setup.exe TRANSFORMS=Unattended.MST /qb-", "REG_SZ");
}

So it now works! Go figure!

thanks for the input!

TWILL

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...