Reputation: 31
In my MSI installer package I have a custom action which adds a RunOnce key. However, it surprised me to observe that, at the end of the install, the RunOnce key is invoked immediately (and then deleted), whereas I was anticipating this to occur only when the pc is restarted. Is this behaviour standard, or can it be switched off? This is happening on Windows 7 64-bit. Any help gratefully received, many thanks in advance. Cheers, Andrew.
Upvotes: 1
Views: 1011
Reputation: 31
I solved my problem by using the RunOnceEx reg key, instead of RunOnce. Everything works as expected now. Cheers!
Upvotes: 2
Reputation: 11013
Can you try the package on another Win7 machine, even virtual machine? From what I know only the restart should invoke the key, so maybe there is something corrupted on this machine that causes the behavior.
EDIT: After posting I found this MSDN blog which says the key can get invoked in certain conditions. http://blogs.msdn.com/b/junfeng/archive/2006/09/19/761765.aspx
To avoid the key invocation you could try to execute the custom action that creates it as late as possible during the installation.
Upvotes: 3