none
Deploying Application with run on the windows startup RRS feed

  • Question

  • I am using Setup and deployment project from visual studio 2005.  Can I know how to create the setup , so that the application will run on the windows startup.

    Thursday, April 24, 2008 10:37 AM

Answers

  • Hi,

        Based on your description, I guess you want to make setup project to install an application, meanwhile this application will start everytime Windows startup.  If that is the case, I think there will be some information about Windows registry which can help you a lot.

     

        You know, the startup application list is stored in the registry entry : 

        HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\

     

        "Start" -> "Run" -> enter "regedit", and you will see the Windows Registry Editor, then find the above key, you will see the startup applications of your OS.  The value is defined as followed:

        "Your Application Name" (Name)       REG_SZ (Type)      "The path of the application in hard disk" (Data)

     

        After we know these, we can build such a setup project as followed:

        1. After you have built your own application project, Right Click the "Solution" to "Add a New Project", of cource the project type is Setup and Deployment Project. 

     

        2. Add the "Project Outputs" into the setup project, here, it can be the your own application,

     

        3. Most of important step:  Open the "Regstry" view of the setup project, then add new keys in "HKEY_LOCAL_MACHINE" according to the information I just mentioned.  Below the key "Run", you can add a new string value.  Then in the value's "Properties" view, enter "[TARGETDIR]YourApplicationName.exe" .

     

       4. Install your application using the msi file created by setup project, then restart your computer, you can see the result. 

     

        Important to mention, if un-install the application, the startup setting will be deleted together.

     

       Hope these will help you.

     

    Best Regards,

     

    Fat-ZhiZhi

    Friday, April 25, 2008 9:00 AM

All replies

  • Hi,

        Based on your description, I guess you want to make setup project to install an application, meanwhile this application will start everytime Windows startup.  If that is the case, I think there will be some information about Windows registry which can help you a lot.

     

        You know, the startup application list is stored in the registry entry : 

        HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\

     

        "Start" -> "Run" -> enter "regedit", and you will see the Windows Registry Editor, then find the above key, you will see the startup applications of your OS.  The value is defined as followed:

        "Your Application Name" (Name)       REG_SZ (Type)      "The path of the application in hard disk" (Data)

     

        After we know these, we can build such a setup project as followed:

        1. After you have built your own application project, Right Click the "Solution" to "Add a New Project", of cource the project type is Setup and Deployment Project. 

     

        2. Add the "Project Outputs" into the setup project, here, it can be the your own application,

     

        3. Most of important step:  Open the "Regstry" view of the setup project, then add new keys in "HKEY_LOCAL_MACHINE" according to the information I just mentioned.  Below the key "Run", you can add a new string value.  Then in the value's "Properties" view, enter "[TARGETDIR]YourApplicationName.exe" .

     

       4. Install your application using the msi file created by setup project, then restart your computer, you can see the result. 

     

        Important to mention, if un-install the application, the startup setting will be deleted together.

     

       Hope these will help you.

     

    Best Regards,

     

    Fat-ZhiZhi

    Friday, April 25, 2008 9:00 AM
  • Hi,

     

    Thanks for your reply. I need to deloy this application in my client machine. He dont want any human intervention in between. Is there any possible way to do this. I got a code from http://www.codeproject.com/KB/shell/scheduler.aspx, but in this we need to do some thing under the Control Panel\Administrative Tools\Services and double click on "Services".

     

    Is there is any way to o this without any manual intervention ?

     

    Thanks

    jshree.

     

    Wednesday, April 30, 2008 7:48 AM
  • Hi,

         I think my method doesn't any intervention of your client computer.  

     

         You can check it carefully that it just need some settings of your setup project, then give the output msi files to your client.  After he runs the msi files, the applications will of cource be installed and more important the application will run each time Windows startup.  There are no manual intervention here.

     

        Thanks,

     

    Best Regards,

     

    Fat-ZhiZhi

    Friday, May 2, 2008 8:16 AM
  •  

    Hi, Thanks for your response. I have tried the above, but on running the setup I am getting the following error "Could not write value MyValue to the key MyKey. Verify that you have the sufficient access to that key, or contact your support personnel. " . Please note, the windows user I had logged is having the poweruser permission and I am also able to create the key under HKEY_LOCAL_MACHINE  manually, and it is working fine. The problem I am facing only on running the setup. Can you suggest me a solution.

     

    Friday, May 2, 2008 9:17 AM
  • Hi,

         Sorry again for the delay, I have checked your problem of the Registry Key Access problem.  And maybe you should do some settings on your Windows Registry.  

     

         I guess your application is running on Windows XP:

         a. Open Registry Editor, on the Edit menu, click Permissions.

         b. Click the registry key for the user who is currently logged on, and ensure that Read and Full Control permissions are both set as Allow.

         c. Click the Advanced button, ensure that the user who is currently logged on is selected, that Full Control is listed in the Permissions column, and that This Key and Subkeys is listed in the Apply to column.

         d. Click Apply, and then click Yes when you are prompted to continue.

         e. Click OK, and then click OK again.

     

         Try this way please, if it does not work, please be free to ask.

        

         Hope I can help.

    Thanks,

    Best Regards,

     

    Fat-ZhiZhi

    Monday, May 5, 2008 1:32 AM
  • Hi,

     

    I have tried by setting the full permission but still I am getting the same error....

    Can you help me.

     

    Thanks,

     

     

    Monday, May 5, 2008 8:47 AM