How Do I: Set the installed Path in the Registry from a setup project?
-
I have written a PowerPoint Add-In and am working on the install package. I created the setup project and am trying to set a registry entry to the location that the application is installed (whatever that may be). I must do this to have access to the install directory as with COM add-ins all the application path properties in the Framework return *OFFICE's* application path, not my add-in's. So in the registry part of the setup I have set several static values but also want to set one that is dynamic based on the install location. Anyone know how to do this? --Tony Archer "I can build it good, fast and cheap. Pick any two."
-
I have written a PowerPoint Add-In and am working on the install package. I created the setup project and am trying to set a registry entry to the location that the application is installed (whatever that may be). I must do this to have access to the install directory as with COM add-ins all the application path properties in the Framework return *OFFICE's* application path, not my add-in's. So in the registry part of the setup I have set several static values but also want to set one that is dynamic based on the install location. Anyone know how to do this? --Tony Archer "I can build it good, fast and cheap. Pick any two."
First of all, if these add-ins are .NET assemblies, you can always get their path using
Assembly.GetExecutingAssembly().Location
, among a few similar ways. To set the path in the install, though, set the registry value to [INSTALLDIR] (more than likely, if all your assemblies go into the same installation directory). There are much better ways but the VS.NET Windows Installer project doesn't make them possible without using a tool like Orca (from the Windows Installer SDK) and modifying the MSI package after it's compiled, which also requires some knowledge about MSI packages.Microsoft MVP, Visual C# My Articles