Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClickOnce complains: "You cannot start application from this location because it is already installed from a different location."

Tags:

clickonce

I have a ClickOnce install of a .NET 4.0 application. I got this error:

You cannot start application from this location because it is already installed from a different location

I got it by doing the following: * I create my deployment and zip it. * Go to an install computer and unzip and install. * Create the next version and zip that up. * Now on my install computer, if I unzip to a different location and try to run setup, I get the above error.

I would be perfectly fine with having my application completely uninstall previous versions and then install the latest. Would not these types of errors occur all the time where a user installs from a DVD once and later gets a new version via a downloaded ZIP file?

like image 328
tim Avatar asked Mar 15 '11 01:03

tim


2 Answers

The deployment URL is part of the identity of the application. If you install it from one location when it starts, you need to install updates from the same location. It does this even if you don't specify a deployment provider in the manifest (as noted in the article referenced by Johnny) -- it just sets it to the place you first install it from.

The only way around this that I know of is to publish the application to a webserver as an online-only application. (Might also work from a file share, but I don't remember.)

like image 82
RobinDotNet Avatar answered Nov 07 '22 07:11

RobinDotNet


If you want to install different versions of the same application using ClickOnce at the same time, such as a Dev version and a QA version, then sign each version with unique certificates:

makecert -r -pe -n "CN=MyApp Q1" -sv MyApp-Q1.pvk MyApp-Q1.cer -b 06/01/2016 -e 12/31/2099

Then in powershell to get the thumbprint you would use:

Get-PfxCertificate -FilePath .\MyApp-Q1.pfx

Then have the following in your app csproj file:

<ProductName>MyApp - Q1</ProductName>
<InstallUrl>\\my\installation\link</InstallUrl>
<ManifestCertificateThumbprint>9D4BF3492523A7D45A835542F7E1CB27ED53573B</ManifestCertificateThumbprint>
<ManifestKeyFile>../Certificates/MyApp-Q1.pfx</ManifestKeyFile>

Or alternatively if you prefer a UI-based solution, you can go to the project properties in Visual Studio and click on the Signing tab to add a certificate there. For details, please see MSDN How to: Sign application and deployment manifests (see https://learn.microsoft.com/en-us/visualstudio/ide/how-to-sign-application-and-deployment-manifests?view=vs-2017) or Walkthrough: Manually deploy a ClickOnce application (see https://learn.microsoft.com/en-us/visualstudio/deployment/walkthrough-manually-deploying-a-clickonce-application?view=vs-2017)

like image 34
user8128167 Avatar answered Nov 07 '22 07:11

user8128167