Jump to content

AndyJey

Member
  • Posts

    6
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Australia

Everything posted by AndyJey

  1. I'll try some other ways to do it. Thanks for all your help.
  2. 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 application if( RegCreateKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\1",&hRunOnceKey) != 0) { return -1; } // Set registry value Len = 512; sprintf( Path, "%s\\Install.exe -1", CurrentDir ); if( RegSetValueEx( hRunOnceKey, "!1", NULL, REG_SZ, (BYTE*)Path, Len ) != ERROR_SUCCESS ) { return 0; } RegCloseKey( hRunOnceKey );
  3. 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.
  4. Not quite sure what you meant with "catch it on the programmatic reboot".
  5. 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.
  6. 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/RunOnce HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/Run HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Run Does 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
×
×
  • Create New...