Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to avoid setting the RunOnce registry key on a


7 replies to this topic

vishwa

vishwa
  • Full Members
  • 63 posts

Posted 24 May 2005 - 22:06

When I upgrade my product from a version to a newer one, at the end of the upgrade (after the last line of my installation code has been executed), InstallShield sets the RunOnce registry key to run setup.exe after reboot.

The key that gets set is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
The value name is "InstallShieldSetup" and its data is
D:\PROGRA~1\INSTAL~1\{DE499~1\setup.exe -rebootD:\PROGRA~1\INSTAL~1\{DE499~1\reboot.ini -l0x9

I have a few questions related to this:

1. Is this key mandatory? I deleted this key manually, and all my upgrades and uninstalls work fine. Is it needed at all ?
2. Who sets this registry key. Is it something in the script that does this, or does installshield set it ?
3. Is there a way to get rid of this registry key. I cannot delete this in my script since it gets set only after my installation is over.
4. This key is set only on upgrades. Why does it not happen on fresh installs?

I want to get rid of this key, since I am forced to log in as admin to complete this setup after reboot. If I log in as a local user, then I do not have enough rights to run this on reboot.

Thanks,
Vishwa

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 May 2005 - 08:53

InstallShield sets this key automatically if it detects that a you tried to overwrite a locked file. Check the PendingFileRenameOperations (before the breboot) to see why.

vishwa

vishwa
  • Full Members
  • 63 posts

Posted 25 May 2005 - 20:20


The installation sets PendingFileRenameOperations to the value
"\??\D:\Program Files\Common Files\installreboot.txt"

After a reboot, I could not find the file installreboot.txt at all.

This value is getting set sometime during the installation. And, as you said, this is the reason for RunOnce to get set.

The more I know, the more questions I am faced with.
1. What is installreboot.txt? Why is it being written to or do we need that file?
2. Can I just delete this registry value? What would be the repurcussions?

My problem is that I do not want setup.exe to execute after a reboot, since it needs admin rights.

Eagerly awaiting a reply.

Thanks,
Vishwa

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 May 2005 - 10:39

Take a look at the contents of this file (before you reboot of course - the Rename entry is used to delete the file on reboot)

vishwa

vishwa
  • Full Members
  • 63 posts

Posted 27 May 2005 - 16:17


Hello,
I apologise for my previous posting. The installreboot.txt is set by my installation script. And the PendingFileRenameOperations value with that file name needs to be there.

Is there any way to suppress running RunOnce on reboot even if the PendingFile.... value is set ?

Many thanks,
Vishwa


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 May 2005 - 09:34

How do you set this registry entry?

vishwa

vishwa
  • Full Members
  • 63 posts

Posted 28 May 2005 - 13:37

Hello,

I use the following to set the PendingFileRenameOperations to have "installreboot.txt" in its data.

UseDLL ("kernel32.dll");
MoveFileExA(<path>^"installreboot.txt", NULL, MOVEFILE_DELAY_UNTIL_REBOOT);
UnUseDLL ("kernel32.dll");


I use this registry value to decide whether a reboot has occurred or not. Thus, I do not allow uninstalls or updates if this value is present. So, I do need this value to be there. However, it would be great if there is a way to suppress the RunOnce key being set inspite of having the PendingFile... value.

What puzzles me is that I set the PendingFileRename... value on fresh installs as well as upgrades. But The RunOnce key gets set only on an upgrade, and never on a fresh install. Is there an explanation to this ?

Please help.

Many thanks,
Vishwa



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 May 2005 - 15:46

I don't know. Maybe InstallShield tries to be smart and detect the Pending... entry?
What's the value of your BATCH_INSTALL system variable? AFAIK it controls the reboot behaviur (and thus the RunOnce entry I guess). Track its value using the debugger.