Sanket
Sanket

Reputation: 463

Set registry key through ClickOnce installation

I need to add my application to the startup and hence, need to set the Registry Key with the Installation path. I have got this working through the Visual Studio Setup project but can't figure out how to do it through a ClickOnce deployment.

Anyone know how to set registry keys when using ClickOnce for installation?

Upvotes: 5

Views: 9964

Answers (2)

Jin Thakur
Jin Thakur

Reputation: 2773

You should use Visual studio installer. Earlier VS removed installer project. But now they are offering it with marketplace project for free. https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects It is a suggestion.

Upvotes: 0

codeConcussion
codeConcussion

Reputation: 12938

ClickOnce can't do this. If you want your app to start when the user logs in, you have to write code in your application to do it (copy a shortcut to the startup folder, edit the registry, etc.)

Also, keep in mind that if you write code to handle this scenario, it won't be undone when the user uninstalls your application.

Here is a forum question and blog post that should help you out. And here are similar SO questions, 401816 and 1650650.

Upvotes: 6

Related Questions