AndyJey Posted December 2, 2008 Posted December 2, 2008 Hi everyone,I have developed an application which requires other Microsoft components and other 3rd party device driver to be installed on the target machine. As I can only get InstallShield and .MSI files from the 3rd party vendor, I am writing a small installer application that spawns the required MS component intsallers and 3rd party's installer packages. My installer detects which software has not been installed and spawns the appropriate installer package.One of the software that I need to install first is Windows Installer 3.1, if it has not been installed on the target machine. At the completion of Windows Installer 3.1 installation, the PC is required to be re-booted. As I need to restart my installer after the PC has been restarted, I added the following registry value Install = "C:\MyInstallDir\Install.exe" in the HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/RunOnce registry key, before Windows Installer 3.1 installation is spawned. However, the Install program did not get executed after the PC re-started. The entry in the RunOnce registry key was still there.If I re-boot the PC manually, with the above RunOnce registry value, my Install.exe gets executed.I have tried using the following registry keys with the same result:HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/RunOnceHKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/RunHKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/RunDoes any one know the differences between Windows Installer automatic reboot and manually rebooting the PC?Can anyone please advise how to correctly use the RunOnce registry key to resolve the problem?Thanks,Andy
iamtheky Posted December 3, 2008 Posted December 3, 2008 I use runonceex and my installs resume (I just increment the autologon for every reboot). I know there once was criteria like putting an (!) before your entry in the RUN key to get it to execute upon restart, dont know if that went by the wayside because its never worked for me. The runonceex deletes lines as executed and will run any remaining lines upon restart. dont know if GUIrunonce will perform similarly?
AndyJey Posted December 4, 2008 Author Posted December 4, 2008 I tried your suggestion. After Windows Installer completed the installation and rebooted the PC, I noticed the entry under RunOnceEx registry key was deleted, but my program still didn't get executed. I tried prefixing the value name with "!", but still didn't work.
iamtheky Posted December 4, 2008 Posted December 4, 2008 if you catch it on the programatic reboot and send it into safe mode, are there any entries in the runonce?
AndyJey Posted December 4, 2008 Author Posted December 4, 2008 Not quite sure what you meant with "catch it on the programmatic reboot".
iamtheky Posted December 4, 2008 Posted December 4, 2008 hit whatever key will give you your boot options and select safe mode.
AndyJey Posted December 5, 2008 Author Posted December 5, 2008 Hi imtheky,Thanks for the explanation.At the completion of Windows Installer 3.1 installation and before the PC was rebooted, the RunOnceEx registry entry was there. After the PC has been re-booted, the entry was gone, but the program in the RunOnceEx registry entry did not get executed. This happens in normal mode and Safe mode.I also did a test, where I chose not to let Windows Installer 3.1 installation to automatically reboot the PC upon completion, by checking the "Do not restart now" checkbox. Then I manually restarted the PC. If I did this, the RunOnceEx intermittently got executed. Really weird.
iamtheky Posted December 5, 2008 Posted December 5, 2008 yeah they shouldnt run in safemode out of the runonce.Since the entry remained present when you booted into safe mode that just shows it was not attempting and failing.Why not slipstream installer3.1? that way you can eliminate its peculiar function from the runonce.KB893803 /integrate:%source%might help if you post the other entries you are trying to run and see if they might be to blame as well.
AndyJey Posted December 5, 2008 Author Posted December 5, 2008 I might not be clear enough in my previous post. When the PC was booted into Safe mode, the RunOnceEx entry was gone. There is only 1 program that I am trying to run.Below is the code I used to add the RunOceEx registry entry.// Code snippet to add RunOnceEx entry//// check, if RunOnceEx registry key exists {if( RegOpenKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx", 0, KEY_ALL_ACCESS, &hRunOnceKey ) != 0 ){ // if not, attempt to create it if( RegCreateKey( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx", &hRunOnceKey) != 0) { // failed to create RunOnceEx registry key return -1; }}// create a new registry key for our applicationif( RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\1",&hRunOnceKey) != 0){ return -1;}// Set registry valueLen = 512;sprintf( Path, "%s\\Install.exe -1", CurrentDir ); if( RegSetValueEx( hRunOnceKey, "!1", NULL, REG_SZ, (BYTE*)Path, Len ) != ERROR_SUCCESS ){ return 0;}RegCloseKey( hRunOnceKey );
iamtheky Posted December 6, 2008 Posted December 6, 2008 have you tried getting away with aNet stop msiserverafter the install, maybe whoever needs it next will call the new stuff? (could very well yield the cant be accessed error but I'd try it)The intermittent functionality makes it brutal. The key looks fine when you comment out all the 3.1 stuff and run it?
AndyJey Posted December 9, 2008 Author Posted December 9, 2008 I'll try some other ways to do it. Thanks for all your help.
yiannis Posted December 16, 2008 Posted December 16, 2008 Hello,I have the same problem with you. Did you find anything?
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now