Run/RunOnce Keys

F

freaky

Hey there,

small question, I've been looking into the Run/RunOnce keys and can't seem
to figure 1 thing out (it's not on
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/se
tup/run_and_runonce_registry_keys.asp anyways).

If for example in RunOnce I have programs 1, 2, 3 & 4, do they get executed
one after another, or all at once? (IE, does program 2 start when program 1
is still starting or does the boot procedure wait for program 1 to either
finish or go into background). This is important, because if I would add 4
installers (to install 4 programs) you wouldn't want to run the installs at
the same time as this could corrupt the registry. Also, if program 1 decides
it needs to reboot for it's installation to finish program 2, 3 and 4 might
not be done yet but they might be removed from the registry anyways and thus
not run on reboot and they will not install at all (or atleast improperly).

TIA
 
M

Mark V

freaky wrote in
Hey there,

small question, I've been looking into the Run/RunOnce keys and
can't seem to figure 1 thing out (it's not on
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/se
tupapi/se tup/run_and_runonce_registry_keys.asp anyways).

If for example in RunOnce I have programs 1, 2, 3 & 4, do they get
executed one after another, or all at once? (IE, does program 2
start when program 1 is still starting or does the boot procedure
wait for program 1 to either finish or go into background). This
is important, because if I would add 4 installers (to install 4
programs) you wouldn't want to run the installs at the same time
as this could corrupt the registry. Also, if program 1 decides it
needs to reboot for it's installation to finish program 2, 3 and 4
might not be done yet but they might be removed from the registry
anyways and thus not run on reboot and they will not install at
all (or atleast improperly).

Excerpt from MS KN article: 179365

"With the exception of the HKEY_LOCAL_MACHINE\...\RunOnce key, all
keys and their entries are loaded asynchronously. Therefore, all
entries in the RunServices and RunServicesOnce keys can potentially
run at the same time.

Entries in the HKEY_LOCAL_MACHINE\...\RunOnce key are loaded
synchronously in an undefined order.

Because the HKEY_LOCAL_MACHINE\...\RunOnce key is loaded
synchronously, all of its entries must finish loading before the
HKEY_LOCAL_MACHINE\...\Run, HKEY_CURRENT_USER\...\Run,
HKEY_CURRENT_USER\...\RunOnce, and Startup Folder entries can be
loaded.
"
 
T

Torgeir Bakken (MVP)

Mark said:
Excerpt from MS KN article: 179365

"With the exception of the HKEY_LOCAL_MACHINE\...\RunOnce key, all
keys and their entries are loaded asynchronously. Therefore, all
entries in the RunServices and RunServicesOnce keys can potentially
run at the same time.

Entries in the HKEY_LOCAL_MACHINE\...\RunOnce key are loaded
synchronously in an undefined order.

Hi

In practice, they run in the order that they was created in the registry. If
you export the RunOnce registry key, the order that you see in that file, is
the order that they will be run in.
 
F

freaky

Thanks for the info people. I didn't really care about the order, but it's
always nice to know :)

Have a good day and thanks again.
 
M

Mark V

Torgeir Bakken (MVP) wrote in
Hi

In practice, they run in the order that they was created in the
registry. If you export the RunOnce registry key, the order that
you see in that file, is the order that they will be run in.

Thanks Torgeir. I suspected as much. The article (perhaps) should
be updated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top