How To: Change start location of a signed ClickOnce Application

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.

About Gabriel Schenker

Gabriel N. Schenker started his career as a physicist. Following his passion and interest in stars and the universe he chose to write his Ph.D. thesis in astrophysics. Soon after this he dedicated all his time to his second passion, writing and architecting software. Gabriel has since been working for over 25 years as a consultant, software architect, trainer, and mentor mainly on the .NET platform. He is currently working as senior software architect at Alien Vault in Austin, Texas. Gabriel is passionate about software development and tries to make the life of developers easier by providing guidelines and frameworks to reduce friction in the software development process. Gabriel is married and father of four children and during his spare time likes hiking in the mountains, cooking and reading.
This entry was posted in ClickOnce, How To, Setup. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Roman Samec

    for me works this:
    mage -Update MyApp.application -pu MyUrl -cf MyCert.pfx