Jump to content

RunOnceEx after a user logs on?


Recommended Posts

Greetings all, please forgive me if this problem has been addressed or mentioned elsewhere on the forums. Doing a search did not turn up anything related to my particular problem - which is with Adobe Reader 9, and the last option after it, CLEANUP.CMD - they don't seem to want to work as I need them to without being run from a user who is actually logged on. Does that make sense?

Basically, I've been working on a custom WinXP Pro SP3 installation disc. So far, I've successfully integrated the following software: (My source disc was WinXP Pro x86 with SP2.)

Service Pack 3 (This was integrated by running the .EXE with /INTEGRATE.)

Internet Explorer 7 + All Updates / Hotfixes (I used nLite for integrating this one.)

Media Player 11 + All Updates / Hotfixes (via the WMP11 Slipstream tool.)

Various Microsoft Hotfixes that showed up in Windows Update after I installed all the above. (All were manually input using the SVCPACK folder and corresponding .INI file.)

Then, I setup RunOnceEx (following the excellent guide(s) on this forum) to install some third party software, which follows:

.Net Framework 1.1 (Some programs need it, so I want it to auto-install.)

.Net Framework SP1 for v1.1 (And should probably update it ...)

Hotfix for .Net v1.1 with SP1 (And heck, why stop there? Let's update it some more!)

.Net Framework 3.5 with SP1 (This installer (from MS) already had the v3.5 and SP1 put together.)

DirectX 9.0c (2008 Redistributable from MS.)

Sun Micro JAVA (Whatever the latest version is.)

Adobe Flash Player 9

Apple QuickTime player v7.5

Adobe Acrobat Reader 9 (This is where the problem starts ...)

CleanUp.cmd (I've got this posted below for you to see ...)

So ... my problem is that for some reason, Adobe Reader 9 doesn't install. The setup program launches, but when XP finishes running RunOnceEx and actually logs the first user on, Adobe Reader is not there ... no icons or anything - not even listed in Add/Remove Programs (although everything else installed from RunOnceEx is listed there.)

Then ... a few of the commands to be executed in CleanUp.cmd do not work properly.

I don't think the problem is with Adobe OR CleanUp ... because what I think is going on is that Adobe will not install correctly unless the user is logged on somehow. Then, CleanUp goes in and attempts to delete icons from the desktop that are normally placed there by MP11 and Adobe Reader. But, the WMP11 icon remains because it does not appear until AFTER the user logs on, which is AFTER CleanUp.cmd has executed. The odd thing is, everything else in RunOnceEx workes perfectly.

What I've thought about doing is using RunOnceEx to copy another .CMD file to the AllUsers\Programs\Startup folder that will launch the Adobe Reader installer and THEN delete the icons I don't want on the desktop. But, this would make the entire install process seem a bit untidy to me ...

Hopefully, I'm making sense ... here's a copy of the RunOnceEx.CMD file I'm using, and the CLEANUP.CMD file. If anyone has any thoughts or suggestions, please let me know. Is there a way to delay RunOnceEx from starting until AFTER the first user has logged on?

My RunOnceEx.CMD:

@CMDOW @ /HID
@ECHO OFF
TITLE=WindowsXP Setup

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Windows XP Setup" /f

REG ADD %KEY%\005 /VE /D ".Net Framework v1.1 SP 1" /f
REG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\dn11.exe /q:a /c:\"install.exe /q\"" /f
REG ADD %KEY%\005 /V 2 /D "%systemdrive%\install\dn11sp1.exe /Q" /f
REG ADD %KEY%\005 /V 3 /D "%systemdrive%\install\kb928366.exe /Q" /f

REG ADD %KEY%\015 /VE /D ".Net Framework v3.5 SP 1" /f
REG ADD %KEY%\015 /V 1 /D "%systemdrive%\install\dn35.exe /q /norestart" /f

REG ADD %KEY%\020 /VE /D "DirectX 9.0c" /f
REG ADD %KEY%\020 /V 1 /D "%systemdrive%\install\dx90c.exe" /f

REG ADD %KEY%\025 /VE /D "JAVA for Internet Explorer 7" /f
REG ADD %KEY%\025 /V 1 /D "%systemdrive%\install\java.exe /quiet /norestart" /f

REG ADD %KEY%\030 /VE /D "Adobe Flash Player 9" /f
REG ADD %KEY%\030 /V 1 /D "%systemdrive%\install\flash.msi /quiet /norestart" /f

REG ADD %KEY%\035 /VE /D "Apple QuickTime Player v7.5" /f
REG ADD %KEY%\035 /V 1 /D "%systemdrive%\install\qtsetup.exe /quiet /norestart" /f

REG ADD %KEY%\040 /VE /D "Adobe Acrobat Reader 9" /f
REG ADD %KEY%\040 /V 1 /D "%systemdrive%\reader9.exe /s /rs" /f

REG ADD %KEY%\040 /VE /D "Finalize Settings and Reboot" /f
REG ADD %KEY%\040 /V 1 /D "%systemdrive%\install\cleanup.cmd" /f

EXIT

My CLEANUP.CMD:

@CMDOW @ /HID
@echo off
Title=WindowsXP Setup
shutdown.exe -r -f -t 60 -c "Windows will reboot your computer in 1 Minute..."
net user aspnet /delete

DEL "%AllUsersProfile%\Start Menu\Programs\acrobat.com.lnk"
DEL "%AllUsersProfile%\Desktop\acrobat.com.lnk"
DEL "%AllUsersProfile%\Desktop\adobe reader 9.lnk"
DEL "%AllUsersProfile%\Desktop\QuickTime Player.lnk"
DEL "%HomePath%\Desktop\Windows Media Player.lnk"

RD /S /Q %systemdrive%\install\

PAUSE
EXIT

Thanks in advance for any help or suggestions on how I can make this work! By the way, CLEANUP.CMD is working ... because it DOES delete the QuickTime icon, but it doesn't delete the Windows Media Player.lnk, but that might be because it points to the %HomePath% directory which isn't active until AFTER RunOnceEx finishes it's stuff. So, hopefully someone knows of a workaround or something for this ...

Regards,

Dave

Link to comment
Share on other sites


Well, I have got a crazy idea, dont't know will it helps you or not but read this one.

Maybe you will start Adobe Reader installation AFTER first reboot - by making a link in startup folder?

cleanup.cmd:

@CMDOW @ /HID
@echo off
Title=WindowsXP Setup
net user aspnet /delete

DEL "%AllUsersProfile%\Start Menu\Programs\acrobat.com.lnk"
DEL "%AllUsersProfile%\Desktop\acrobat.com.lnk"
DEL "%AllUsersProfile%\Desktop\adobe reader 9.lnk"
DEL "%AllUsersProfile%\Desktop\QuickTime Player.lnk"
DEL "%HomePath%\Desktop\Windows Media Player.lnk"

move %systemDrive%\adobereader.cmd "%Homepath%\Start Menu\Programs\Startup"
shutdown -r -t 20 -c "Don't Worry, Windows Will Reboot in 20 sec."
EXIT

adobereader.cmd:

@CMDOW @ /HID
@echo off
title Finishin'...
start /wait %systemdrive%\reader9.exe /s /rs
RD /S /Q %systemdrive%\install\
DEL "%AllUsersProfile%\Start Menu\Programs\acrobat.com.lnk"
del %systemDrive%\reader9.exe
del adobereader.cmd
exit

What about this?

PS If I have any mistakes, sorry... :unsure:

Link to comment
Share on other sites

Is there a way to delay RunOnceEx from starting until AFTER the first user has logged on?

I used the the folowing KEY to install some softwares that require User specific settings:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

This KEY will load after HKLM\\\RunOnceEx, HKLM\\\RunOnce and all the services have been loaded and before StartUp.

The command is same as HKLM\\\RunOnce.

Link to comment
Share on other sites

  • 3 weeks later...

Hello everybody! I think I foud what's your problem my friend. Look at the last lines of your runonceex.cmd file:

REG ADD %KEY%\040 /VE /D "Adobe Acrobat Reader 9" /f
REG ADD %KEY%\040 /V 1 /D "%systemdrive%\reader9.exe /s /rs" /f
REG ADD %KEY%\040 /VE /D "Finalize Settings and Reboot" /f
REG ADD %KEY%\040 /V 1 /D "%systemdrive%\install\cleanup.cmd" /f
EXIT

You can see the numbers of acrobat and cleanup are the same, 040, so cleanup overwrites acrobat in the registry and it's like acrobat never existed in runonceex entry. Plz correct me if I'm wrong :rolleyes:

Link to comment
Share on other sites

OK everyone ... I figured out what was going on ... actually, thanks to thepeterp for pointing out my code errors :thumbup

Unfortunately, that wasn't the only cause of my problems (because I realized the errors in the code shortly after I'd posted the help request here, and Reader still wasn't installing correctly).

Anyway, when I downloaded Acrobat Reader from Adobe, they offered different packages for download. One was an EXE compiled installer (which was what you saw in my earlier post.) A different package was a good ole fashioned MSI package. I downloaded the MSI package and made changes to the RunOnceEx.cmd, and it works perfectly!

Thanks to everyone who posted their thoughts and stuff. When I (finally) get done with this CD, I will post my specifics and stuff on here for anyone who might be trying to do the same things I am but hasn't had much luck.

So far though, the CD is perfect, and now I'm working on setting up the drivers stuff. I downloaded all the DriverPacks from Bāshrat the Sneaky's page, and I've consolidated a lot of them into a different folder structure, which successfully allows me to get all the drivers within the 4096 character limit in WinNT.sif. I got it down from over 4096 characters to about 2080 or so ... (I didn't really like the way the DriverBASE program was manipulating the Setup CD I was working on, so I opted to do things manually, but still use all the drivers collected in the DriverPacks.)

Unfortunately, there's no way for me to test the driver package installations without using this disc on real hardware, and I don't have a computer to sabotage right at the moment.

I will post all the details and all my files when I get this project done.

Thanks again to all who put in their 2-cents-worth! :thumbup

Regards,

Dave

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