Jump to content

RunOnce - can't seem to get this working


Recommended Posts

Posted

So I've been an avid nLite user for quite some time, and am putting out nice clean installs, with updates, without any issues.

What I've been diving into lately is using the RunOnce section to enhance the installs, so for example, I can install Office 2007 during the whole process.

For my RunOnce section in nLite, I have %SYSTEMROOT%INSTALLER\Install.bat in the box to run.

In my ISO file, right in the root level of the disk, there is in fact an INSTALLER folder, and in there, the Install.bat. The Install.bat works perfectly, I am just not getting the darn thing to call correctly.

Can anyone point out what I'm missing here? I'd like to keep my directory structures in tact, there's a lot of stuff going on in there, but if I'm way off on how I'm supposed to be doing this, I'm okay with reconstructing and doing it the preferred, more standard way.

Thanks all,

10k


Posted

%SYSTEMROOT% needs to have a \ as in %SYSTEMROOT%\INSTALLER\Install.bat

%SYSTEMROOT% points to your Windows directory. Not C:\ for instance.

In my ISO file, right in the root level of the disk, there is in fact an INSTALLER folder, and in there, the Install.bat.

For that you need to use %source% (without the / in this instance).

To use %SYSTEMROOT% you need to use the $OEM$ folders.

Posted

Thanks for the reply, much appreciated.

This will let the installation programs run during install, off of the disk itself correct? I'm trying to keep this as simple as possible for myself later on, put in disk, end up with a "base" image after it's done.

When in fact do they start to install? Is it during the Windows XP install, when it's flipping through all of the new features of XP, the Look and Feel, etc. etc, or does it do it when you first boot up and log in to the PC?

Thanks again,

10k

Posted (edited)

This will let the installation programs run during install, off of the disk itself correct?

As long as you are using nLite, yes. %source% is the root of the CD.

or does it do it when you first boot up and log in to the PC?

During the first boot but before you get to the logon screen.

Edited by -X-
Posted

Got it, thanks for the very clear explanation and answers. I'm anxious to get to a computer and test this out, I can't believe it was something that simple I was missing.

-10k

Posted

I actually am using VMWare right now to test this out. I am still having an issue firing off the bat file, which is really driving me nuts.

I changed my original RunOnce command (%SYSTEMROOT%INSTALLER\Install.bat) to %SOURCE\%INSTALLER\Install.bat. No luck. Tried taking out the first backslash, %SOURCE%INSTALLER\Install.bat, and still no luck.

As soon as windows loads though, I explore the CD, double click my bat, and off she goes, no issues.

When I originally posted, I was trying it on a spare PC in my office. With the %source% alteration, I am trying it on VMWare offsite, so that is a variable, but I figured it would be fine as the ISO was used to install windows. the ISO is on a USB drive though at this time, but the drive is showing up in Windows, as the VM loads.

I have to be missing something obvious, I'm finding the same code elsewhere and others have had success. That's really all I've changed during this whole testing process.

Posted (edited)

What are you using to call the command? For example, in nLite (RunOnce section) one would have to enter

cmd /R %SOURCE%INSTALLER\Install.bat

Cheers

Edited by Sp0iLedBrAt
Posted (edited)

Did this one from an actual DVD burn, although through a VM.

This is from my LAST SESSION.INI file -

[GuiRunOnce]

CMD /R %SOURCE%INSTALLER\Install.bat

I thought for sure that would do it, I wasn't using the CMD command at all to call the bat.

Could this issue be because I'm not using an auto-logon for the system? The system loads, I get to the Administrator screen, enter in my password, then it continues through setting up first time use settings, browser, etc. etc. Never hit the CD once to even tease me.

The Installer folder is present, the Install.bat is present and I tested it again from the CD to be sure, and sure enough, fired right up and ran.

My bat is just doing an Office 2007 install (for now). I even added a Pause to the end of it to hopefully catch an error, but like I said, I never get to it to even get an error.

I'm still tinkering. Not to be stupid, but I can change the LAST SESSION.INI file through a text editor, and then just re-add it to the ISO right, or do I need to alter it through nLite itself?

*EDIT* - I'm an id***. Of course that won't alter the nLite functionality, it's just my last session.

Edited by 10kman
Posted
My bat is just doing an Office 2007 install

Where is the Office2007 folder placed? For all my RunOnce installs I use the $OEM$ folder with separate sub-folders inside.

I'm not really sure if not having autologon should affect the RunOnce process, since I normally use autologon or don't use a password for the other user name. The only other difference I see is that I use a .cmd, not a .bat file.

So, make an $OEM$ folder, put the INSTALLER folder inside and try this CMD /R %SOURCE%$OEM$\INSTALLER\Install.bat OR make things simpler and just put installer.bat in the root without the folder and use cmd /R %source%installer.bat That's how I do it.

Not to be stupid, but I can change the LAST SESSION.INI file through a text editor, and then just re-add it to the ISO
Why would you change the Last Session.ini? If it's for the purpose of making changes to the RunOnce section, I'm afraid it's going to be a bit more complicated than that. You'll have to open your nLited CD/I386, find nlite.cm_ and copy it to C:\ Then, open Command Prompt and type (without the numbers, of course)

1. cd c:\ <- hit Enter

2. expand nlite.cm_ nlite.cmd <- hit Enter

Minimize Command Prompt. Inside the file (right-click -> Edit to open) you will find

for /f "tokens=3" %%i IN ('reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v "SourcePath" ^| findstr "REG_SZ"') do set SOURCE=%%i

cmd /R %SOURCE%INSTALLER\Install.bat

EXIT

This is what you should modify. When you're done, save and close. Now you have to compress it again. In Command Prompt, type

makecab nlite.cmd nlitecm_ Copy it back in I386 and that should be it.

Posted

My office 2007 install folder is in my INSTALLER folder, on the root of the DVD. I was trying to "package" everything into one spot and go from there, so it'd be simpler.

With the Install.bat on the root of the disk, do I still use the $OEM$ folder technique or is that for if I want to do your first suggestion, and put the INSTALLER folder in there, and install that way? I can do either I understand them both equally.

Posted (edited)

Hi 10kman

I would suggest you simplies your installation method.

Wrap Office 2007 with Winrar SFX as silent installer.

Then Slipstream into svcpack folder using standard svcpack.inf method. But you run the Office installer during RunonceEx.

You can take my uTorrent addon as sample approach.

IMHO, this method is easy once you get the hang of it.

The output will be like this: Svcpack.inf only add RunOnceEx entry. Hence installation only take place during RunonceEx. And installation will be from your DVD disc.

Regards

Edited by Geej
Posted

Thanks Geej for the alternative approach. I did not yet try that.

I'm still not able to get this RunOnce thing working. It's really bugging me too because it's supposed to work, and has obviously worked for others, and the programmer in me is just dying to know what is wrong so I can fix it.

I've burnt actual disks to try, in the event that my VM wasn't working for some silly reason, but it still failed.

I've been tied up with other projects so had to step away from this for a couple days. I'm hoping the fresh air so to speak will let me see the light when I mess with it again. it's really annoying!

10k

Posted

Yes, need to break away and stop thinking over it for a few days if still can't figure out why fail.

I do that when I really get struck and nothing I tried seems right.

When relook a few days later with a completely fresh state of mind, my perspective might change and a solution might just prop up.

Good luck.

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