471,335 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,335 software developers and data experts.

Run at startup with dependent files?

Greetings,

I'm trying to have an application resume after a reboot, by making an entry
into the Run registry key ("SOFTWARE\Microsoft\Windows\CurrentVersion\Run ") .

This works great, and my application starts up after a successfull reboot.
However, my application needs to read a text file in the same directory as
the executable, and for some reason, it cannot access this file when the
program is started by the Run registry key. If I run the executable manually,
it can find the text file just fine. Is there a way to allow my application
to access other dependent files when being run in this manner? Any ideas
would be appreciated.

Thanks,
Peter
Dec 13 '05 #1
6 1253
I answerd my own question. It turns out all I needed to do was give my
program the full path the text file, instead of allowing it to assume it is
in the same directory, and that solved it.
"Pyerwoh" wrote:
Greetings,

I'm trying to have an application resume after a reboot, by making an entry
into the Run registry key ("SOFTWARE\Microsoft\Windows\CurrentVersion\Run ") .

This works great, and my application starts up after a successfull reboot.
However, my application needs to read a text file in the same directory as
the executable, and for some reason, it cannot access this file when the
program is started by the Run registry key. If I run the executable manually,
it can find the text file just fine. Is there a way to allow my application
to access other dependent files when being run in this manner? Any ideas
would be appreciated.

Thanks,
Peter

Dec 13 '05 #2
Are you building in program logic to handle a situation when something
like adaware prevents you from adding an entry to the startup registry
key?

Dec 13 '05 #3
No, i haven't built in anything like that yet, but I would love some
suggestions if you have any.

Thanks,
Peter

"gr***********@gmail.com" wrote:
Are you building in program logic to handle a situation when something
like adaware prevents you from adding an entry to the startup registry
key?

Dec 13 '05 #4
I've only had one app that needed a reboot to continue the
installation. In order to get around the inability to add items to the
\Run reg key (it took me 20 mins to remember I had adaware blocking it
on my own machine) I added my own application registry key and used a
ContinueInstall flag which was cleared by the finishing setup in the
\Run reg key.

If the main app was started with the ContinueInstall still set true I
would either a) warn the user to allow the install to continue through
rebooting or b) finish the upgrade/install from the main application if
it's allowed by the system.

I've found a series of apps that prevent \Run keys other that adaware.
Symantec will do it, Mcafee can prevent it and MS's spyware app can
prevent it as well.

Dec 13 '05 #5
I try to use the \Run reg key and check to see if it failed by using
the application launcher to check the ContinueInstall flag. If the
flag is set I can warn the user that the install didn't finalize and
they need to perform another reboot while allowing the \Run key to be
set.

Now, 99% of end users will end up calling when you tell them that the
\Run key was blocked by their system as they wont know what blocked it
or how to allow it but with spyware what it is these days it's a very
common issue we run into where app installs wont get access to the \run
key.

One thing we've added to our installer is a check to make sure the key
is in the \runonce key before rebooting the machine. This gives the
user the chance to allow the program to be given access to the \runonce
key before the reboot takes place. We still have the issue where users
who've installed blocking software still have no idea *how* to allow
access but thats a different post.

Dec 13 '05 #6
So if you don't use Run or RunOnce, what mechanism do you use to start the
program after the reboot?
"gr***********@gmail.com" wrote:
I've only had one app that needed a reboot to continue the
installation. In order to get around the inability to add items to the
\Run reg key (it took me 20 mins to remember I had adaware blocking it
on my own machine) I added my own application registry key and used a
ContinueInstall flag which was cleared by the finishing setup in the
\Run reg key.

If the main app was started with the ContinueInstall still set true I
would either a) warn the user to allow the install to continue through
rebooting or b) finish the upgrade/install from the main application if
it's allowed by the system.

I've found a series of apps that prevent \Run keys other that adaware.
Symantec will do it, Mcafee can prevent it and MS's spyware app can
prevent it as well.

Dec 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Neil Benn | last post: by
12 posts views Thread by chinkuang | last post: by
12 posts views Thread by rdemyan via AccessMonster.com | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.