I'm creating a setup pacakage in Visual Studio 2008 to register a COM component and one of the actions is to add a few keys to the registry.
The odd thing about it is when I run the installer it creates the key hierarchy correctly but the last key in the hierarchy it creates has the wrong GUID... whereas its right in the installer... has anyone run into this or have any suggestions on what is going wrong?
Thanks
I had the same (or a similar?) problem, my solution is here: How to register COM from VS Setup project?
Basically I just created the registry keys manually and added them to the setup project as a .reg file :)
Related
I created an addin with VSTO and a setup project with visual studio installer.
Im totally new on creating setups... and im getting something weird here (most likely a rookie problem).
I have what follows...
When i install, files get deployed into the folder, like below... and i suppose its the way it should be.
But when i try the addin, i get the following error, like if the manifest is pointing to a different path:
Then for the sake of testing i copied the manifest into the folder he seeks, like so:
And them, the add-in loads correctly...
Though I need some guidance with 2 scenarios:
where or how can i fix this pointing to that folder?
Is there a way to perform a delete on a specific registry key when program is uninstalled?
Please i have this important job to finish at my work and im burning nails...
Many thanks in advance for your time taken to read and help.
Before installing the add-in make sure it is unregistered (if you debugged the project previously there). Also make sure that your installer added Registry entries for VSTO Add-ins on the target machine that correspond to the actual location.
In general, make sure that you did all the steps describe in the following articles (depends on what installer you chose for deploying the add-in):
Deploy an Office solution by using Windows Installer
Deploying a VSTO Solution Using Windows Installer
Started a new project and copied all the code from the previous one... started working.
I cannot understand what witchery Visual Studio does some times.
I am trying to create an installer for an outlook add-in built in VS 2019 Community. I am using the setup extension. It works on my local computer but only because it is the device the VSTO was created on. My problem is create it work universally. When I check the add-in location that works locally, it is pointing to the VSTO in my visual studio project.
I have added the primary project output to the Application Folder in the File System setting, and I have changed the Register property to vsdrpCOM.
It works locally like I mentioned, but I need it to work universally. It does produce a setup.exe and setup.msi as well. I know it is something little I am missing but I thought I would turn to the community for some help.
First of all, make sure that you included all the required prerequisites to the add-in installer. This is the first point to check among others.
Make sure that you did steps described in the Deploy an Office solution by using Windows Installer article.
I know this is an old post but I forgot to update the answer.
My issue pertained to creating the registry keys. I thought the keys would populate in the setup project, I was not aware I had to create every key myself. This was my first time doing a project like this.
So the short answer is make sure you create all the keys as posted in the link above by Eugene.
I create a new custom project type using a VSPackage project inheriting of MPF library (http://mpfproj11.codeplex.com/). As a result I obtain a .vsix but I need add this project type using a .msi. I'm using the Visual Studio 2010 Setup projet for it. In my setup project I add the content of the VS Package in the same directory where the .vsix put then, but I think Ineed to put in the registre the new type of project because when I use the setup , the project template does not come out in Visual Studio and when I give double click the file with extension of the type of new project and does not recognize it. When I look the registry after install the vsix, this was one of the things that I found diferent. I add this entries in my setup project but It's not working yet.I'm missing something else?
In the projecttemplatedir is the directory where I put the .dll of the project type, the vsixmifest and pkgdef. The project template is in [User]\Documents\Visual Studio 2013\Templates\ProjectTemplates\[Name of new Project Type]\[projecttemplate.zip]
Best Regards
PS: The project type is for VS 2013 but I'm using the VS 2010 Setup project ;)
OK, so first the "don't"s of doing this:
In general, if you are installing via MSI you shouldn't be doing anything user-specific -- no writing in HKEY_CURRENT_USER, nor writing within their Documents folder, LocalAppData, or Visual Studio folders, etc. If you see yourself writing files or registry keys in either of those places, that should be your hint that there's a better way to do what you're trying to do. For what you've shown so far, this raises more than a few red flags for me.
Second, don't ever go writing keys into 12.0_Config. That part of the hive is nothing more than a cache that's built up from other parts of the registry and on-disk .pkgdef files from extensions. It's rebuilt in any number of senarios, including installing new extensions. Any writes there you should presume will get blown away at any time. If you need to write things there you should either (a) write in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\[version] and run devenv /setup or (2) [preferred] put your keys in a .pkgdef inside your extension which gets merged into 12.0_Config for you automatically.
Now the dos:
You said you already had a .vsix produced by the SDK: you can put project templates in there. You can then register those templates in the .vsixmanifest and those will pull in. That's far easier than mucking around with files in Documents -- that's the user's directory...don't go playing with that.
Once you have a .vsix that does most of what you need, you should simply take the files within that and install the files in a folder within C:\Program Files [(x86)]\Microsoft Visual Studio 12.0\Common7\IDE\Extensions. Even better, you might just want to WiX toolset to build your installer, since it has built-in support for installing extensions. It also has built-in support for invoking the "/setup" process if that's what you need to do as well. Visual Studio Setup projects are no longer supported in newer versions of Visual Studio, so you're better off starting with a technology that isn't already obsolete. WiX is even what we use at Microsoft to do the setup work for Visual Studio itself, so it's definitely up to the task.
Last point: almost everything when it comes to Visual Studio extensibility can be done with a VSIX directly, so presume there's a good way to do something that way before falling back to an MSI. Internally, we can register the entire C# and VB language services with just a VSIX -- they're quite powerful.
I found the answer in this link Registering Project and Item Templates. I set projecttemplatedir entry with
[User]\Documents\Visual Studio 2013\Templates\ProjectTemplates[Name of new Project Type][projecttemplate.zip] that is where i put the project template.
I've created a VS2010 extension to manage a new type of project. I've created the VSIX file with the project and item templates inside, and everything works fine, i'm able to create a new project, syntax highlight, compile it, etc.
What i want to do now is to associate my files (.stadyn) to the VS2010, like a .cs file. I mean, give it an icon and open the VS2010 on a double-click.
Does anybody know how to deploy the extension and add those keys to windows registry?
Thanks in advance.
You have to possibilities.
Create an installer for your extension which is doing all the stuff.
Add the file associations when the extensions first starts.
I would prefer option one, since then you can also uninstall your extension and unregister the file associations and may be do other cleanup stuff. Also you could do other stuff during the install.
Edit:
Deployment is documented in the MSDN:
http://msdn.microsoft.com/en-us/library/ff363239.aspx
I created an MSI setup via Visual Studio 2008 for my application, and added a registry key to windows\run for automatic startup, but also implemented a function in my application to disable automatic startup. However, when the application is restarted, the key is automatically repaired.
How to prevent MSI from repairing the key??
Thank you!
The registry key is repaired because it was installed by your package and Windows Installer knows that it should be present. Some possible solutions are:
Move the entry in a separate component which doesn't have a Component ID. This way the component is not registered with Windows Installer.
Use a custom action to create the registry entry during install.