I have a config file that needs changed on a per-server basis, so that once a server has our software installed on it, the config file for a client installer is set up to match that server's particular settings, and then copied to a public folder on the web for deployment.
Since I'm changing the config file, I also have to rebuild the *.manifest and *.application files, and as I understand it, my only real option for this is to use Mage.exe from the Win7 SDK. In order to fix the *.manifest file with the proper hash from the modified config file, I run:
mage -new Application -fd ".\Application Files\<appName>_1_0_0_0" -ToFile ".\Application Files\_1_0_0_0\<appName>.exe.manifest" -Name "<appName>" -Version "1.0.0.0" -CertFile "key.pfx" -password "<password>"
and then, to fix the *.application file with the proper hash from the modified *.manifest file, I run:
mage -new Deployment -I t -t "<appName>.application" -v "1.0.0.0" -appManifest ".\Application Files\<appName>_1_0_0_0\<appName>.exe.manifest" -pu "http://<hostaddress>/<path>/Application Files/<appName>_1_0_0_0/<appName>.exe.manifest" -CertFile "key.pfx" -password ""
Now, this all works, and I get the message that the files were successfully signed. When I try to install the client app though, it's obvious that something has gone awry when I get an error log with the message:
+ Deployment manifest is not semantically valid.
+ Deployment manifest requires <deployment> section.
In looking at the *.application file, it has some additional information under the "deployment" node, which the same file directly from the publish feature of VS2008 does not have:
<deployment install="true">
<subscription>
<update>
<expiration maximumAge="0" unit="days" />
</update>
</subscription>
<deploymentProvider codebase="http://<hostaddress>/<path>/Application Files/<appName>_1_0_0_0/<appName>.exe.manifest" />
</deployment>
The VS2008 publish version simply has:
<deployment install="true" />
When I remove the additional information and set the deployment node to a self terminating node, then re-sign the file, everything works as expected.
Is this a known issue and is there any way to get Mage to create the file without the extra information in the deployment node so that it will work properly?
EDIT: As a temporary solution, I am loading the files into an XmlDocument and modifying them to suit, then re-signing the files. Additionally, I'm now facing the issue of being as yet unable to determine how to add an icon to the deployment, so the Start menu item gets an icon other than the generic icon.