Run Key

  • Thread starter Thread starter James
  • Start date Start date
J

James

This question has been asked a thousand times, and I've searched for it a
thousand times, but I still can't make it work. I want an application to
automatically run after user logon. If I manually go to a command prompt and
type "c:\myapp.exe 0 1 0" it runs just as expected. However, when I put that
same string "c:\myapp.exe 0 1 0" into the
LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run key it never
works. Please note that I have also tried the string "%24%\myapp.exe 0 1 0"
in the Run key as well - with the same results. What am I missing? Thanks in
advace for any help.
 
Hello James,

I did the following steps and it works:

Step 1) In the SLD browser, right-click on the Components folder and select
ADD Component.
Step 2) In the Name property, name the Component MyJamesAPP.
Step 3) In the Description property, type:

The MyJamesAPP application is a copy of myapp.exe application. It will
automatically be launched after every login.

Step 4) To specify a repository, click on the Repositories button to the
right of the Repository property.
Step 5) Select the MyJamesApp Repository from the list, and then click the
OK button.
Step 6) In the SLD browser under the MyJamesAPP componenet, right-click on
Files, select Add, and then click on Files.
Step 7) For the Target name property, type myjamesapp.exe
Step 8) For the Source name property, type myapp.exe.
Step 9) To specify the directory where the file will reside in the run-time
image, click on the right arrow button (>) to the right of the Destination
property.
Step 10) Select %11% from the list. The parameter %11% is a DIRID that
represents the directory \Windows\System32.
Step 11) Click the OK button.
Step 12) In the SLD browser under the MYJamesAPP compnenet, right-click on
Registry Data, select Add, and then click on Registry Data.
Step 13) To the right of the Key name property, click browse button.
Step 14) Under the root key HKEY_CURRENT_USER, browse to and select the
registry folder Software\Microsoft\Windows\CurrentVersion\Run, then click OK
button.
Step 15) In the Value name property, type MYJAMESAPP.
Step 16) In the Type property, Select REG_SZ from the pull-down menu.
Step 17) In the Value property, type myjamesapp.exe.
Step 18) Click the OK button.

Amir Ahani, Bsc
Software Developer
Motion Metrics Inc
http://www.motionmetrics.com
(e-mail address removed)
 
Amir,

Thank you for your suggestion. I followed your instructions to the letter -
only substiting "myapp.exe" for the real name of my application. However, I
am still unable to get this to work. I viewed the registry with regedt32
after the XPE image was up and running - no run key was present. So, I
manually inserted the key, but it still doesn't work. Why doesn't XPE work?
This is a very basic task that should be very quick and easy.

Thnaks.
 
for my application the run-key works. Maybe the the app needs something
(network ?) that is not completely started and your app quits with an
unhandled exception ? Have you tried with some other app like notepad.exe ?
 
You can check in Target Designer whether there is the run key listed
in the registry-entries of your component.

Perhaps you can also see something in fbalog.txt. I have got a run key
and every time my computer is started the following line is added to
%windir%\fba\fbalog.txt:
13:46:50 PM - [FBALaunch] myapp.bat
 
It sounds like your compenent is getting built too early - have you tried
looking at which the last component built in the log and setting the build
order dependency of your component so that it builds after that?
 
Back
Top