I need to include a runtime as part of a project installer.
I was having trouble including it, as an error saying "an installation is already in progress" was appearing, due to the fact that I was essentially trying run an msi from within an msi.
I managed to get over this by including it in the "OnAfterInstall" event, however it appears now that it is not being installed on upgrades, only on fresh installs.
Can anyone offer any advice?
Thanks
You don't specify what version of the Visual C++ Runtime, but this may work:
Visual Studio Installer Projects provide a prerequisites setting which is pre-populated with a list of common components. These are .mst files, so they can be merged into your installer. To reach the prerequisites screen, right-click your installer project -> Properties -> Prerequisites. Check the appropriate box in the list and change the option at the bottom to include the prerequisite in the setup program.
apparently you should add it as a "merge module" in your MSI http://blogs.msdn.com/b/vcblog/archive/2007/10/12/how-to-redistribute-the-visual-c-libraries-with-your-application.aspx
Related
My Visual Studio 2008 setup project is changed so that merge modules for MFC and VC have replaced DLL's that were installed manually in the installation folder. I'm okay with merge modules, but there is a problem. In previous setup user could choose between "Everyone" and "Just me". In new setup this choice has no effect, and installation is always for everyone because of merge modules, which must be installed for everyone. So, if previous installation was "just for me" then new installation does not remove DLL's of previous installation, and in Control Panel there are two installations with the same name.
In setup project of new version ProductCode is changed, UpgradeCode is not, RemovePreviousVersion is set to true, and Version is higher than it was before.
If I exclude merge modules from setup, and install new version "just for me" then all is well. Old files are removed, and there's only one installation in Control Panel. But I would rather not burden users with separate installation of redistributable packages.
How can I in Visual Studio 2008 setup have both merge modules, and instruct setup to remove previous version, even though previous version was "just for me", and new is for "everyone"?
Mаybe better question would be what would you do in my place to resolve this issue?
Windows Installer (handler of MSI files) will not uninstall one product during the installation of another. Also, the same installation is viewed as two different products when installed both per user ("just me") and per machine ("everyone"). It is therefore nothing you can do from .msi to uninstall old per user installation if new is to be installed per machine.
Options are, ordered by preference:
Make bootstrapper installation (.exe) that would seek and uninstall all that needs uninstalling. Bootstrapper is also preferred way to install prerequisites, instead of doing with merge modules.
From .msi you can just detect that something is wrong, and stop the installation. I've done this, but will work on first option as well.
Ignore the problem, say it's by design, and do nothing. It's all in the hands of the user.
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.
I am creating the deployment project (.MSI) for my .NET Windows project (Visual Studio 2010) using the advanced installer 8.x by adding some driver and 3rd party SDKs. I added them as prerequisites by choosing the product keys as conditions, but when I run the project it’s popping the prerequisites even after they get installed. Its status is not changing to installed and popping up every time.
How can I fix it?
Prerequisites use detection criteria to determine if they are installed or not. So most likely your prerequisite install conditions are not correct.
Usually a prerequisite is detected by searching for a file or registry entry installed by it. To see what files and registry entries are installed by a package you can use Process Monitor or a repackager tool.
I have an update to third party .DLL that must be installed onto my clients' computers. We currently employ automated installs via MSI that are created in Visual Studio 2010
Unfortunately, the third party .DLL was versioned incorrectly and file version of it was not increased by the provider (they only increased assembly version). The third party provider is Microsoft, so waiting on them to fix the issue is not realistic. We need to get the new .DLL to people now and within one MSI update. Right now, MSI update is not overriding the .DLL
Is there a way within VS2010 Setup project to force override a .DLL even if the file versions match?
If you are willing to do msi postbuild tweaking you can hit the File table and do "version lying". Another thought is to not put that DLL in your install. Find an installer from Microsoft ( if it exists ) that you can put into a bootstrapper or create your own installer and use AMUS instead of OMUS for the version rules.
Can't you just add the file to your installer as a 'file' and install it with the other files? Don't set it as project output, or any of the canned install actions. Go to the file portion and right click the "Application Files" folder, and say > add file. Navigate to the file that you want and choose it.
I'm using Visual Studio 2005. I have a program written in C#. When I create the installer and then add the primary output, it's not picking up any dependencies. Not even .Net. Anybody have any ideas?
I fixed my own problem, but figured I would post the "fix" in case any else should run into the problem.
I went back under my main project>references and removed the references to other projects. Then I right clicked on each of the other projects and removed them. I added them all back and rebuilt the project. Then I right clicked on the "Detected dependencies" folder in the installer and hit refresh dependencies and it detected them all
If you want to install the .NET Framework with your setup, you should add it under "Pre-requisites" on the property pages of your setup and deployment project.
Then the created bootstrapper (i.e. the setup.exe file) will check whether the specified version of the .NET Framework is present on the target system and install it as needed.
Please note that this check is only done by the setup.exe file and not when the user double-clicks the msi file. The reason for that is that Windows installer does not allow one msi file (your installer) to start another msi installation (e.g. the .NET Framework installation).
Try to do a build of your installer, it may add the dependencies at that time.
Your dependency dll must be in binary search path of windows.
That is PATH=/path/to/dll must be in environment.
Just in case it helps somebody... None of the other answers worked for me... It seems the cause of the issue for me was that I was adding the 'Primary output' and 'Content Files' in one step (at the same time)... once I deleted them both and added them individually it worked.
i.e. once I removed them both ('Primary output' and 'Content Files') and added 'Primary output' the Detected Dependencies folder was populated correctly, I then continued to add the 'Content Files'.