Is there a way to rename a deployed ClickOnce application?
My company has a ClickOnce application that has been in use with our customers for about a year now.
We're going through a re-branding and want to change the name of the application. However, just changing all of the normal name options in Visual Studio, and then building a new deploy obviously changes the manifests that the existing application is looking for, so essentially any installed applications never see the new updates.
I've tried messing around with the .application file, but I haven't been able 开发者_StackOverflowto get anything to work yet. Is there a way to rename a deployed ClickOnce application, or do we have to get people to just install the new application?
If you want to run two different versions of an application, all you have to change is the assembly name to make ClickOnce think it's a different version. Which makes me wonder if you don't change the assembly name of your main application if it would still appear to ClickOnce as the same application.
If you have to change the assembly name (and I would), then you are going to have to have your users uninstall and reinstall the application. You can do this programmatically for them; it only takes a minute.
The MSDN article Certificate Expiration in ClickOnce Deployment on ClickOnce certificate expiration shows you how to programmatically uninstall a ClickOnce application and reinstall it from a different URL (the code is available). We've done this a couple of times, and it works really well and isn't that intrusive to the users.
I'm pretty certain you can't just build the new version to a new URL and copy the deployment manifest into the old deployment folder, because you are changing the application identity, and it won't recognize it as an update, but you could always try it.
Unless you have it built into the application you will need to redeploy it. You can rename the file, but the GUI will not be changed without something in the code behind to do it.
If you only want to change the "Start Menu" name and "Add/Remove Programs" name, you can change the "Product Name" without changing the assembly name. I did a quick test and updates still seem to work on a test certificate, but you should test it yourself to make sure.
With a project selected in Solution Explorer, on the Project menu, click Properties.
Click the Publish tab.
Click the Options button to open the Publish Options dialog box.
Click Description.
In the Publish Options dialog box, enter the name to display in Product name.
Optionally, you can enter a publisher name in Publisher name.
From https://learn.microsoft.com/en-us/visualstudio/deployment/how-to-specify-a-start-menu-name-for-a-clickonce-application?view=vs-2019
This article from MSDN might be useful:
Walkthrough: Manually Deploying a ClickOnce Application
One of the posts states trying the following.
Unfortunately Mage does not have functionality to support .deploy-renaming. A workaround is to:
- Generate the application manifest.
- Sign the application manifest.
- Add the
.deploy
extension to all files except the.manifest
file - Create the application manifest, modify the deployment tag, and add parameter
mapFileExtensions="true"
. - Sign the application manifest.
精彩评论