Lately I had to fix a ClickOnce application for a customer who changed the start location of the application. Since the path of the start location of the ClickOnce application is part of the (signed) manifest the setup does not work any more if you change it.
The following steps are needed to fix the setup.
- Open the Visual Studio command prompt.
- Run the mage.exe tool (Manifest Generator Tool).
- Open the .manifest file of the (latest) setup. This file can be located in the directory with the highest version number in the “Application Files” sub folder of your deployment directory (e.g. c:your_new_deployment_folderapplication filesyour_application_1_2_3_11)
- Save this file and when asked to sign the file select “Sign with certificate file“. Localize your certificate file (e.g. your_application.pfx)
Note: a new .pfx file can be created either by the mage tool or by Visual Studio
- Now open the .application file which is located in your deployment folder (e.g. c:your_new_deployment_folder)
- Select the “Deployment Options” section and enter the new “Start Location” (e.g. c:your_new_deployment_folderyour_application.application)
- Switch to the “Application Reference” section and select the .manifest file that you changed/saved previously.
- Save the .application file and when asked to sign the file again select “Sign with certificate file” and localize your certificate file.
That’s it. The application can now again be installed from the new start location.