Visual Studio 2013 Setup Project - IpOverUsbSvc - c#

Let's assume
I've a C# application (Visual Studio 2013)
and a setup project (Visual Studio Installer Projects) for it.
When I try to install the generated msi-file I get the following error message:
The following applications are using files which the installer must update. You can either close the application and click "Try Again", or click "Continue" so that the installer continues the installation, and replaces these files when your system restarts.
Windows Phone IP over USB Transport (IpOverUsbSvc) (Process Id: xxxx)
How can I get rid of this error message?
I know that I can terminate this windows service which comes with Visual Studio. But I don't wont to do that on all clients which have Visual Studio installed.
I'm not using Windows Phone in my application. Why does the installer tries to replace that file?
Regards Wollmich

At the risk of stating the obvious, it means that you are installing a file that the phone service also uses. Remember that there are many common files shared by Windows apps, such as C++ run times and others. Unless you list the files you are installing then nobody can know which file it is. Be careful that you are not installing Windows shared files in your MSI instead of with a standard redistributable that should be installed via prerequisites.
If you do the install and create a log file with msiecec /I [path to your msi] /l*v [path to text log file] you can then look in the log file. There should be 1603 messages that say exactly which files are the issue.
The big issue with REINSTALLMODE and damus is that it applies to ALL files in the MSI that are being installed, so it won't update any of your older files either. The right thing to do is figure out what files are involved and why you are sharing them with a phone service.
Note that it is strictly speaking not an error message - it's a standard files-in-use dialog telling you that you can avoid a potential reboot by shutting down the process(es) using files that need updating.

Related

Install Visual Studio ClickOnce applications on Windows 10 from Ansible when manufacturer cannot be verified

I have an Ansible playbook connected to hosts with Windows 10. I need to install a couple of applications that I develop in Visual Studio on those hosts. For this, I compile these applications with the publish option of Visual Studio. This sends me to the ClickOnce publication wizard, in which it generates a setup.exe and a .application.
I have tried several ways to run these files, with ansible.windows.win_command, ansible.windows.win_shell and ansible.windows.win_package, but none have worked for me, and I don't get any error in the output of the command. When I go to one of these hosts and run the setup.exe or the .application from PowerShell the following window appears:
Unable to verify manufacturer. Confirm that you want to install this application?
Which asks me, "Unable to verify manufacturer. Confirm that you want to install this application?" and I need to click on install, but the idea is that I should automate this process with Ansible since the hosts should not have interaction with a human.
I want to do this without the need to create credentials or register a manufacturer, maybe with some configuration in the Windows Registry. It should be some command that allows me to install without asking or some configuration when publishing my application from Visual Studio.

In-use files not updated by MSI-installer (Visual Studio Installer project)

I'm using the Visual Studio Installer Projects extension to build the MSI-installer for my application. However, my application is meant to be running at all times, and if it's open when the user is installing a new version of my software, the open files are not overwritten, and very little to nothing is actually updated (although there are no installer-errors).
I've found that using the installer project's "Custom Actions" to run a script that closes the application doesn't help, as none of the actions are called before the files are replaced.
Is there a good way to make sure the open/locked files gets terminated before the files are supposed to be overwritten?
We had this problem, and the solution we came up with was to create two apps; the user app and an updater app. The MSI installs both. Each app checks if the other needs updating and, if it does, closes the other app, downloads the other app's updater, runs it, then relaunches the other app. Additionally, each app monitors if the other app is running and, if it isn't, launches it.
It would be useful to know more about your application and how you are doing the upgrade because:
You will normally see a FilesInUse dialog saying that files are in use, prompting the user to shut them down, but not if the install is silent.
Visual Studio setups have no built-in support for shutting down and restarting services, so if your app is a service you'll need extra work.
Files that actually do need to be replaced will prompt the user for a reboot (if they are not previously shut down) in order to replace them at reboot time.
So if you're not seeing reboot requests or FilesInUse dialogs in a UI install then something else is going on. So you need to be sure that:
a. You are really doing an upgrade where the version of the setup project has been incremented, the UpgradeCode is the same (and the ProductCode changes when you increment the setup project's version). Your symptoms could be the result of the upgrade not working and you're seeing just a repair.
b. The definition of "new version" is that you have an upgrade as in a., AND, the file versions of the binaries have been incremented. The default overwrite rules for installs require incremented file versions, so if they haven't been incremented you'll see no updates, and Windows will not attempt to show FilesInUse dialogs or reboot because there are no files that need replacing.
This isn't a solution to the problem, but rather another solution; the one requiring the least work in the end.
I ended up not using 'Visual Studio Installer Projects' for my installer. Instead I looked to Advanced Installer, which just works with no issues. Things like this is taken into account, and custom actions allow for more options.
If your project is open source, you can write to them about a free open source "professional" license, equal to their "professional" plan, which is normally $399 (onetime purchase).
REBOOT: How are you installing this MSI? What command line? If you set REBOOT=ReallySuppress on the command line, you will not be prompted for a reboot even if one is required to complete the installation of the product.
msiexec.exe /i MySetup.msi /QN REBOOT=ReallySuppress
If you are using a distribution system I suppose suppressing reboot prompts could be standard behavior. Then your product files should be put in place after a reboot (PendingFileRenameOperations or perhaps some newer mechanism).
It is also possible that Visual Studio Installer Projects do something strange that I am not aware of.
Log: I would try to create a good log file for the install, to determine what is going on:
msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
Log All MSIs: Personally I like to enable logging for all MSI installations - as described in the "Globally for all setups on a machine" section in the above link.
Interpreting an MSI log: interpreting a log file can be challenging sometimes. Here is an answer with some links to help with this.
Reboot Manager: Reboot management is a very complex topic, and Windows features functionality - in the form of the restart manager feature - to try to minimize the need for reboots, by instead shutting down and restarting applications as part of an installation in an "auto-magical" fashion (application listens for messages and shuts itself down gracefully when told to, and the system may restart the application after the install - if configured to do so).
Updating your application to comply with the restart manager is the only real fix for such problems that you see, in my opinon.
The section "Restart Manager" in this question tries to summarize how to implement such support (maybe just read the yellow section a bit down the page).
The Advanced Installer guys have a very nice, technical article about this:
How do I add support for Windows Restart Manager to my application? Also linked to in the link directly above - still worth a direct link here I think.
According to below link
https://social.msdn.microsoft.com/Forums/windows/en-US/0b40b367-3341-43d8-b82e-1ace546969f8/how-can-installation-stop-and-restart-existing-service-?forum=winformssetup
"There is no good support in VS installs to stop and start services. During install, the issue is that custom actions run after everything is installed so it's too late to stop a service that you are upgrading or replacing. Yes, they have names like "BeforeInstall" but they really are not before the install."

How to Resolve this - Enter an alternate path to a folder containing the installation package

A long time back I developped a Windows service with c# 4.0 and also created a setup file with VS2010 for that app. I installed that app and it was running. someone removed that Windows service not properly like removing some entry from registry regarding that app and as a result that app name is not showing in ADD/Remove list and removed all files and folder from program files folder related to that Windows service.
So when I try to run the setup file for that win service to install it in my pc then I am getting the error message Enter an alternate path to a folder containing the installation package
so guide me how could I again install that Windows service in my pc from that setup. thanks
I've found the "Windows Installer cleanup uitlity" to be enormously helpful in situations like this. It's an abandoned project, but you can still get it by googling. You can use it to completely remove a program from your computer, after which it won't conflict with a new installation.
I found it here:
www.majorgeeks.com
Simply download the file needed and provide the [un]installer with the download folder. And press OK. You can do it without interrupting the process. Do not use the Windows Installer Cleanup Utility It is not supported and extremely dangerous!

WebDev.Webserver40.exe error (not a valid win32 application) - can't compile in Visual Studio 2010

Everytime I try to compile in Visual Studio 2010 I get the error
Unable to launch the ASP.NET Development server. Unable to start program 'C\path.......\Webdev.Webserver40.exe
I also tried to execute this file (Webdev.Webserver40.exe) and I get this error:
WebDev.WebServer40.exe is not a valid win32 application
I already turned off every firewall I have, and I already tried changing the .NET framework of any project, changed to different speceific ports and it's still failing...
What could be happening?
I have Windows XP SP3
I went through the same error. Seems like somehow the webserver embebbed in VS2010 got corrupted.
If you try to Debug a WebSite, the error is "Unable to launch ASP.NET Development Server".
If you try to Debug a Web Application, the error message points to the path of the server.
It's installed under this folder:
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0
The two executables WebDev.WebServer20.EXE and WebDev.WebServer40.EXE were really corrupted (getting error "not a valid win32 application" when try to run).
I had to go to instalation DVD and selected "Change or Remove Microsoft Visual Studio 2010" in the Main Menu.
After that:
Add or Remove features
Uninstall Web Developer
When the uninstalling is complete, do it again:
Add or Remove features
Install Web Developer
Now everything works just fine.
I hope the same resolve to you.

Deploying windows application in Visual studio 2010 Express

I have developed a windows application on C# in Visual Studio Express 2010. Now I want to deploy it.
I used publish to deploy but when I run the project it get error on the form where I have used some external files which I am using for I/O operation, read and write files.
How do I resolve this error? I am also using one folder for files.
I'm a big fan of using WiX for installers - even if you've got Visual Studio Pro with the built in MSI creation tools
http://wix.sourceforge.net/
the benefit of WiX is that you can do most anything, from the super simple to very complicated. The tool is great b/c you can get started quickly and then move up (adding dialogs, etc) as your app gets more popular.
One trick for installers - consider using VMWare/HyperV, install a test OS then take a snapshot of the OS before you install your app. IF everything works, great - you're done. However if something isnt right, roll the OS back to the pre-install snapshot, fix the bug, and try it again.
Add those external files to the project
Right Click the external files in your VS Set the Build Action as Content
Copy to Output directory to CopyAlways
Then try deploying
That may be due Windows 7 UAC permissions. Despite the fact that current books, msdn and even the snippets in Visual Studio teach methods of file IO, most are not correct when taking UAC into consideration.
All of your file operations should take place in UAC safe zones such as
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
You cannot read or write to files in the C:\Program Files (x86) directories unless you have elevated your app to run with higher privileges.
If you install your application and right click the executable and select Run As Administrator and everything works the problem is UAC.
If you haven't coded around UAC limitations I highly recommend reading up on it. It will save many headaches down the road.
http://www.codeproject.com/Articles/17968/Making-Your-Application-UAC-Aware

Categories