Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Add mapFileExtensions automatically
 

Add mapFileExtensions automatically


Hi,

I am creating/signing manifests using the mage tool and
I need to use the .deploy extension.

Is there a simple way to add the "mapFileExtensions"
into the .application files? I have checked the command
line arguments for mage.exe but it does not seem to exists such
an option.

Or is the only way to do this is to create an application
that performs this task? I do not wish to use MageUI or any
other graphical tools, it must be done via commandline so
that it can be automated.

Thanks!

blixt2  Monday, December 11, 2006 10:11 AM
You can insert a 'mapFileExtensions="true"' into the deployment manifest (the one with the .application extension) at the <deployment key just before you sign the deployment manifest.

MS Documentation on this key:

http://msdn.microsoft.com/en-us/library/t7050f3w.aspx

This is assuming you are doing a command line change of the deployment manifest and the code signing thereafter via command line.

I did a global search and replace of the key "<deployment " (Note the space) with
"<deployment mapFileExtensions=%%22true%%22 " (note the space and %%22 which adds quotes to the string at command line execution time).  Kind of tacky to do that to a XML file, but it works, since the "<deployment " key is unique to the .xml file (and <deployment without a space isn't).  If you already have a mapFileExtensions in the key, then this search and replace adds a new one which you don't want.

If you are running command utilities, you can also use XMLStarlet which is a command line utility to process xml file, which was cross compiled from *nix to windows world.  That call is rather complicated compared to the search and replace.

If you are running msbuild or nant as a build, then you can find libraries with a XMLPoke or XMLUpdate/XMLMassUpdate task that will do this for you, and I would prefer that to search and replace in a XML file.
  • Proposed As Answer byDDarwin Wednesday, October 07, 2009 9:47 PM
  •  
DDarwin  Wednesday, October 07, 2009 9:47 PM

You can use google to search for other answers

Custom Search

More Threads

• Msi file not working
• Why my program is not multi-language when i do a setup project ?
• ClickOnce Deployment: Setup cannot find application file specified
• Bundle .NET 3.5 Framework w/Install (using VS 2008 SP1)?
• Environment Variables in Windows Installer
• Upgrade programs on the go ?
• Application Open Twice, Error on Load
• Event firing order in VS.NET deployment projects
• How to make Edit1Value Mandatory Field in Textboxes Dialog
• How to set Full Control Permission to a Folder in Windows Vista Programmatically?