update (Default) value in registry key in setup project

Add-in Express™ Support Service
That's what is more important than anything else

update (Default) value in registry key in setup project
 
Maryna Banova




Posts: 1
Joined: 2022-12-28
Hello!

I create an app that associate .TDPLan(.xlsx) file with my app. If you right-click on the file it'll suggest opening it with the associate app.
If I add registry keys to the app, it works well. (Default) values are updated.

string appName = "TDPlanStarter";
string appPath = string.Format("\"{0}\"", Application.ExecutablePath);
string executeFileName = System.AppDomain.CurrentDomain.FriendlyName;
Registry.ClassesRoot.CreateSubKey(".TDPlan").SetValue("", appName);
Registry.ClassesRoot.CreateSubKey(appName + @"\DefaultIcon").SetValue("", appPath);
Registry.ClassesRoot.CreateSubKey(appName + @"\shell\open\command").SetValue("", appPath + "\"%1\"");
Registry.ClassesRoot.CreateSubKey(string.Format(@"Applications\{0}\shell\open\command", ppName)).SetValue("", appPath + "\"%1\"");

I added the same registry keys in the setup project.
[img]https://drive.google.com/file/d/1JOcQ9-tHRkklA6YV1AJDqWmRvgBIwdNs/view?usp=share_link[/img]
After installing the app I have two (Default) values: one with blank and another with a value. The file doesn't open by the associate app
[img]https://drive.google.com/file/d/1afVKeLL1Z8l3BdU1t0dsWCrFKE9xyVZn/view?usp=share_link[/img]
How I can update the (Default) value in the registry key by the setup project?
Posted 28 Dec, 2022 08:06:53 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Maryna,

I assume you use Visual Studio setup projects. if so, check the documentation at https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/2kt85ked(v%3dvs.100). As to your question, I'd suggest that you google e.g. using this search query: https://www.google.com/search?client=firefox-b-d&q=visual+studio+setup+project+registry+default+value.

Regards from Poland (CEST),

Andrei Smolin
Add-in Express Team Leader
Posted 28 Dec, 2022 08:43:17 Top