0

I know how to tell the registy to run my app on startup. There are a lot of threads about it. I used this one: How do I set a program to launch at startup. The problem I face is: I give the user the option to disable/enable this option when the user uninstall, there is a key left in the registry that tells the app to run (although the app was already uninstalled)

I know I can handle it by a shortcut in the startup folder, but I tried it already and I have problem with it too. Thanks Eli

Community
  • 1
  • 1
Eli Cohen
  • 131
  • 1
  • 10
  • 1
    Usually, the installer/uninstaller would take car of this. – spender Jun 12 '13 at 11:48
  • @spender Question remains: If the admin needs to install/uninstall the application, how should the installer know about all the user profiles and remove the Registry keys from the respective `CURRENT_USER` profiles? – Thorsten Dittmar Jun 12 '13 at 11:55
  • I add the key by the application and not by the installer, so the installer doesn't know about the key. maybe I have to instruct the installer to do it using the registry editor. – Eli Cohen Jun 12 '13 at 23:25

2 Answers2

0

To remove the entry in the registry you should instruct your installation program to remove the registry value.

If you are using the build in installation project in VS you could do that by implementing the Uninstall event.

If it is a click once installation you just have to ignore it.

Casperah
  • 4,504
  • 1
  • 19
  • 13
  • While the obvious idea is to have the uninstaller handle this, the interesting question here is: If the application is installed by the admin and also needs to be uninstalled by the admin, how would the installer delete the key in all possible `CURRENT_USER` profiles in the Registry? – Thorsten Dittmar Jun 12 '13 at 11:54
  • Good question, but is it a big issue? does the user notice anything? – Casperah Jun 12 '13 at 12:50
  • Well, that's what the OP's question is about. He wants to remove the key, but the key is created in the current user's Registry profile. So an installer would have to remove that key in the profiles of all users. – Thorsten Dittmar Jun 12 '13 at 12:53
  • I am using the build in installation project in VS, and I am trying to figure out how to implementing an Uninstall event. I will be glad to have a link to a tutorial/instruction on how to do it. – Eli Cohen Jun 12 '13 at 23:20
  • It is somewhere in the Installer Class, you can either use BeforeUninstall or AfterUninstall, I recommend the later. – Casperah Jun 13 '13 at 09:00
0

Simple solution without using Custom Actions I just added a registry Key by the Registry editor until I got to the Run folder and added to it the value "name of my app" (on the right panel) and I didn't wrote a path just left it "" I played with the checkbox (add key, delete key) and even though I left it with the key. when I uninstalled it was gone.

Eli Cohen
  • 131
  • 1
  • 10