How do I change the Product Code for my application within Visual Studio 2010 ?
I've built a new application by reusing an existing workspace by renaming the folders and namespace. Now when I build an msi file file, it asks me to uninstall the existing app on the server (which is a completely separate app) and I'm unable to proceed..
If you start a new project you're supposed to start a new project from scratch otherwise there are things that get left behind. Apart from the ProductCode you may have the same UpgradeCode as the previous product, and it's probably not a good idea to have two separate products installed with the same UpgradeCode.
The easiest way to change the ProductCode in a Visual Studio setup is to go the Properties Window (not Properties) of the project that shows Manufacturer etc, and ProductCode is there too. Just select it and choose "New Code".
You can create a new Guid product code in the Visual Studio 2010 using the below tool. And replace the new Guid to the ProductCode field in your project.
https://weblogs.asp.net/jevgeni/adding-guid-generator-guidgen-to-visual-studio-2010
Related
How to Create a MSI for windows Applications which is available in different visual studio solution.
If you have installed the installer extension (if not, see notes below), open Visual Studio, then do the following (at this point, no solution is opened):
If you start with a new solution, select File -> New Project.(In case you want to add the installer project to an existing solution instead, right click on
the solution in the solution explorer and choose from the context menu Add -> New
Project.)
In the New Project dialog, select "Other Project Types", then "Visual Studio Installer" and there "Setup Wizard" (Alternatively you can also select a Windows setup project or a Web setup project directly - the wizard has the advantage that it will ask you about several items)
In the Setup Wizard, you can choose whether you want to create a setup for a Windows application or for a Web application. Here, select Windows application.
Click Next >. The "Choose files to include" dialog appears. This step is important, because here you specify which files you want to add to your installer package. Check the items you need to include - for localized projects I suggest that you add: "Locally copied items, Runtime Implementation, Localized resources, Content files" and "Primary output."
Click Next > again to bring up the last page ("Create project" dialog), then click Finish
You have now a solution with one setup project. Now you can add an existing project (select the solution, right-click and select "Add existing project"). After you have done that, right-click on the setup project and select "Add -> Project Output". Now you can select the items to be included in your setup project.
If required, you can also add other assemblies via "Add -> Assembly..." or, if you have that, you can add merge modules.
Notes
You need to install the extension "Microsoft Visual Studio 2017 Installer Projects" (via Tools -> Extensions and Updates, search it online in the Visual Studio Marketplace) to be able to select the installer as described above
that the project you have added can be part of a different solution.
The 4 most important properties of a setup package are: Version, ProductCode, Upgrade code and Platform (default is x86). Version is just a number (e.g. 1.0.1) while the other two properties are GUIDs. If you change the version in the package properties, then Visual Studio asks to create a new ProductCode (if you answer the question with "Yes" - which is recommended). This allows the Windows installer to distinguish the differrent packages from one another and allows to upgrade a package, because the UpgradeCode isn't changed.
Additionally, the default value for RemovePreviousVersions is false - but in most cases you want to change this to true (remember what I said before about ProductCode and UpgradeCode): To remove old versions automatically when you install a new version.
I'm building installer for Outlook add-in with Publish... action in Visual Studio 2015.
I've set up in Publish tab everything: Publisher name, Product name, Publish version etc.
But when I check setup.exe it doesn't show Product name and shows wrong Product version.
How can I make setup.exe have correct Product name and version?
P.S. during installation process product name and version are correct.
Setup.exe don't compiling in build time and it's saved somewhere binary template file. Visual Studio simply adds in template file resources source ClickOnce Application address and it works if you just download single file from server. Here we have 14.0.23107.0 version, and that's mean you have VS2015 and 23107 studio build number. So, unfortunately you can't change it if you use msbuild task for publish.
But you can change it from external application. Just follow this steps:
Download rcedit https://github.com/electron/rcedit/releases
And now you can execute it like me shown below:
rcedit-x86.exe setup.exe --set-product-version "2.2.2.2" --set-version-string "ProductName" Myproduct
Result here: https://i.imgur.com/luN2OrA.png
That's all.
I've written a Visual Studio extension which installs using an MSI. The install puts a extension.vsixmanifest file in the right place, and the extension appears in the Extension Manager as expected:
The problem is, when I publish a new version on the Visual Studio Gallery, the Extension Manager does not report it. I add the new version by creating a new installer and editing the existing page. Each new installer has a new ProductCode, PackageCode and ProductVersion (I update the MSI setup project and the version number in the included extension.vsixmanifest), but the same UpgradeCode; an example 'upgrade' commit can be found on GitHub here.
The issue appears to be that when Visual Studio Extension Manager queries the extensions service for the latest version of my extension, it returns a blank string - the same result as if you query with an invalid extension identifier:
The two extensions successfully queried in the example are the NuGet client tools for VS2015 and the SQL Server Compact/SQLite Toolbox.
What am I missing?
OhhhhhhKAY. I've solved this, and it turned out to be a problem with the Visual Studio Gallery page editor.
When you add an extension, you're shown a VSIX ID box:
When you edit an extension (I'm using Chrome), that box has disappeared!
It's still in the DOM, but it's hidden from view. Because of this, I never entered my extension's VSIX ID into the form, it didn't have a value associated with it, and the extensions service therefore didn't return a version number for that ID. The Extension Manager uses the extensions service to find out the latest versions of installed extensions, so it wasn't reporting new versions of mine.
The VSIX ID box reappears if you deselect then reselect one of the extension's supported Visual Studio versions, so I've been able to assign the ID that way. The service now returns a version number, and the Extension Manager therefore shows available updates:
Probably you may need to raise ProductVersion as well and mind correct version conditions in Upgrade Table in installer project. If this will not help try investigating this issue installing with full verbose log (msiexec /i installer.msi /l*v logfile.log) this may give some clues. The worst case you may want to add an entry to RemoveFiles table to delete this file (during install before deploying your file) but that sounds nasty and i would prefer to avoid it.
I don't think this is a problem with your installer configuration, assuming your installer does, in fact, upgrade your product. If I understand your question correctly, this is an issue with Extension Manager.
Have you tried removing the trailing .0 from your new version string? There might be an poor/unexpected comparison result when comparing a 3-dot version to a 4-dot version.
You could also try doing a more extreme version number change (upping the major version) to see if Extension Manager picks that up.
I have developed and deploy a webpart into SP2010. I would like make some changes to the webpart and show it to my clients but I need to keep the original webpart in case they dont like the new changes. So I would like to have 2 versions of my webpart on the server but use only one Visual Studio project.
In Visual Studio I made the following changes :
1. The solution name ( MyWebPart to MyWebPartNew)
2. The assembly name (from the Properties window of the project)
3. The MyWebPart.webpart file to MyWebPartNew.webpart
+
4. Element.xml
The 'new' webpart is successfully deployed on the server BUT it overwrote my old webpart :( . I looked into the debug output folder and see the dll and pdb file has changed to the new name but not the wsp file.
Have I missed something ? How do I add the new webpart without overwrite the old one from the same project ?
Thanks
The easieast way would probably be to add a new webpart next to your old one. In that case you can simply remove the old one if they prefer the new one.
But in your case, I think your problem is that you didn't change your wsp name (double click "package" in Visual studio) and that you didn't change you solution id (guid in properties window after you click package). What happens when you deploy (from Visual Studio) is that is first retract your old solution and then adds the new one resulting in that your old webpart is malfunctioning.
But as I wrote, I would suggest you instead create a new, identical webpart with your changes in it, and deploy it next to you old webpart.
I have a simple Web Setup project that reads from a Deployable Project.
Even though I have set the Setup to DetectNewerInstalledVersion to false I always get that annoying alert box that a previous installation exists and I need to go to the Control Panel and find the software to remove it...
Is there a way to add a script in a new new installation Dialog that could say A previous version was found, press NEXT to uninstall it. ?
Older versions are uninstalled automatically if you increase your Product Version and change the Package Code. This needs to be done each time you modify the setup project and build a new package.
If you keep the same version and Product Code, older builds cannot be uninstalled automatically. They are detected by Windows Installer before your new package is actually launched. So you need to uninstall them manually.
In my case I found out that the setup project wasn't part of the configuration manager.
Therefore, it wasn't rebuld on solution rebuilds and setup file with the new version and ProductCode wasn't generated.
The solution is simply to right click on the setup project and click rebuild.
Hope this help to future readers :)
The answer is not to use the Visual Studio setup project that's already integrated. I'm having the exact same problem: it won't remove previous versions even though I up the version, set it to remove previous version, check for previous version and rebuild, I can install but the files aren't updated. There are some good tools for this out there, check out bitrock, inno setup or wix.
Also Visual Studio 2010 was the last version with setup project support. It's not included in 2012.
I struggled with this for a long time but it is very simple.
Go to manage VS Extensions (VS2019) and install 'Microsoft Visual Studio Installer Project' v0.9.9
Right click on your installer project and go to properties. Keep the UpgradeCode variable in the properties window the same for different versions of the same product.
Change your ProductCode variable between different builds.
Now when you install the product with the same UpgradeCode already on the system, the installer will upgrade your existing product and you will only have one program in the Add/Remove window.
Create a .bat file
Write this code:
wmic product where name="SetupProgramName" call uninstall /nointeractive
cd Debug
setup.exe
Put this file in installer directory.