I am using Microsoft Visual Studio Installer Projects released for VS 2013. This allowed me to load my .vdproj file created on VS 2010. It all compiled fine. I ran the set up. It ran all the way and at the end displayed this
After that the installation just reverses and goes back and installs nothing.
OK I found a way to recreate the Config.InstallState file.
I found an answer in here
Custom Action - Error 1001: Could not find file myApp.InstallState
The solution is to add the custom action to both the Install and the Commit phases, although it does nothing >> during the install phase.
So this is what I did
Removed my old Config.Install from the Setup project.
Added the custom action to both the Install and Commit phase like the above solution.
Ran the Install - this created a new Config.InstallState file.
Copied this new Config.InstallState into my setup project and removed the custom action from the Install (only kept it for Commit phase)
you can find an answer here:
The problem is that the MSI infrastructure is looking for the installation state file which is usually created during the Install phase. If the custom action does not participate in the Install phase, no file is created.
The solution is to add the custom action to both the Install and the Commit phases, although it does nothing during the install phase.
Related
I try to monitor the memory usage of my CloudService and stumbled upon Application Insights.
When I try to add it I get following error message:
right click on WebProject -> Add Application Insights Telemetrik
Insert Subscription-Data -> click Add-Button
Now the error occurs when VS tries to install 'Microsoft.ApplicationInsights.Web.2.0.0'
We are using VS2015 and Windows 10
Edit:
The fun thing is I can install Microsoft.ApplicationInsights.Webversion 2.0.0 via the nuget-console. But when I afterwards try to add the ApplicationInsights again it throws the same error and the package-manager-console displays:
The package at \Path\To\Project\packages\Microsoft.Bcl.1.0.14 failed to uninstall. Restart Visual Studio to finish the process.
Things you can try:
close VS, and start it once as admin. You may have old auto-updated extensions, etc that haven't been cleaned up until you run as admin. then close that admin VS and go back to your normal non-admin VS.
clear out your nuget packages in your solution, and then doing a full re-build to ensure that all of the current packages in your project are correctly and fully installed. when we try to install the AI nuget packages programmatically, Nuget tries to validate all of the existing packages and sometimes something goes wrong there validating things that already installed
then try re-adding AI through the tool.
if you still get the error, look in the directory shown in the error message, and comment and let me know if (a) that folder exists at all and (b) if it does exist, what's in it?
If things are still failing, you should be able to add the Microsoft.ApplicationInsights.Web nuget package manually from nuget package manager, and after that is done, right click the "ApplicationInsights.config" file that was added by the nuget package install, and you should see a "configure application insights" option that will let you pick your account, subscription, and AI resource, and that will get updated in the config file for you. If none of that works, you can send me a mail to jgardner # microsoft and i can try to track down more details for you.
Edit to add: If you get this error about Microsoft.Bcl, then your project is probably targeting .NET 4.0 and this is probably an issue we just found today. hypothetically, if you manually install microsoft.bcl into the project first, then that specific error for that specific package should go away? (we're working on verifying this specific dependency and fixing this asap).
A simple Visual Studio restart fixed the issue for me.
I am trying to build a large Visual Studio 2010 solution that contains some setup projects from the command line using the following:
devenv.com mySolution.sln /rebuild "Debug|Mixed Platforms" /out E:\myUser\Desktop\build.txt
The MSI files are generated fine. They actually work and install the application as they should be doing it. But here comes the problem: When a change is made on the code and then the solution is rebuilt following the process described before, the application installed by the new MSI does not contain any of the changes made in the code.
Do you have any comment that could help me understand what is happening?
Thanks in advance.
You can't just rebuild an MSI file and install it when that MSI setup has already been installed. You need a RemovePreviousVersions upgrade (increment the version of the setup project in its properties window and say yes to the answers).
This might be useful:
https://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
it still applies except that you must also increment the file versions of the binaries in your setup for them to be updated during the upgrade.
I have a trouble getting a ClickOnce, C#, Visual Studio application to install. I get the following error (retyped):
Setup has detected that the file
C:\...\Reportviewer.exe
has changed since it was initially published.
Click OK to retry the download or Cancel to exit Setup.
I deleted the previously existing Reportviewer, but the error persists. I'm doing this install via VPN (if it matters). What does this actually mean, and what can I do about it?
In the end, I took the ReportViewer prerequisite (and all the other prerequisites, too) out of the published version. We install ReportViewer from here:
http://www.microsoft.com/en-us/download/details.aspx?id=4016
You say that you've deleted the previously existing Reportviewer but there's a strong likelihood that you have some temporary files that are still being referenced during setup.
Try cleaning out any files under C:\Users[Username]\AppData\Local[AppFolderName] or C:\Users[Username]\AppData\Roaming[AppFolderName] manually. If that doesn't work, try using the cleanmgr.exe utility to do a cleanup and then try reinstall.
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 have a web setup project built using VS2008. I've converted my solution to VS2010 and now when I build my new installer and run the install from the MSI it installs fine, then at the last step, removes all the files it's just installed.
I have RemovePreviousVersions set to true. If I turn this off the files remain in place (but I get multiple instances in the Programs and Features in the control panel).
If I run the install again, the files reappear. From then on, the files always remain, even when installing another version. So, the problem seems to be with running an installer built using VS2008 and then running the same installer built by VS2010. The upgrade GUIDs on each installer are the same.
What is the cause and how can I fix this?
I haven't tried porting a setup from VS2008 to 2010, but having the same upgrade code for different build versions will cause problems; simple explanation is the msiexec installer fails when it tries to remove the old components because the older components have the same upgrade version as the newer components being installed. There is a VS project setting where you can automatically generate a new upgrade code each time you rebuild your .msi; I generally select this and saves a lot of these versioning headaches.
Uninstall all copies of your app using
add/remove programs
Delete the contents of your %TEMP% folder ( to
get rid of any "old" (VS2008) copies
of your .msi)
Update the GUID for the VS2010 version (I think you do this by right clicking on the
GUID in the properties window and clicking "genereate new GUID")
rebuild the project and try again!
I just encountered this error. Had the exact problem when upgrading. I tried the solution at:
https://connect.microsoft.com/VisualStudio/feedback/details/559575
I edited my MSI-file in Orca resequenced RemoveExistingProducts right after InstallInitialize (sequence number 1501). This was found in the InstallExecuteSequence table. This was originally sequence number 6550.
That solved my problem.
What I've discovered is that changing the UpgradeCode will prevent the files from being removed, however it's then treated as a separate installed program - i.e. in the control panel (Programs and Features) my program appears twice. Logically, I think, this is because it's not the same program.
My only option seems to be to programmatically uninstall the old version in the installer of the new version by writing a custom action.
I've submitted a bug to Microsoft Connect and they've confirmed it's reproducible.