Skip to main content

Mage

Mage is a command-line tool in Microsoft ClickOnce deployment used to create, manage, and sign ClickOnce deployment manifests, enable simplified distribution, and update Windows-based applications.

注意

Mage is automatically installed with Visual Studio.

Mage can be run from:

  • Batch scripts

  • Other Windows-based applications (including ASP.NET applications)

Integrate mage.exe with Sign Manager Controller (SMCTL) for simplified signing. Alternatively, you can sign directly with Mage and reference your private key stored in DigiCert​​®​​ KeyLocker.

提示

Mage is only compatible for signing on Windows.

What can Mage be used to sign?

Use Mage to sign the following file types:

  • .application

  • .manifest

  • .vsto

提示

When you sign a manifest file using mage, two signature units are consumed. This is because two hash signatures are created for different types of content within the manifest:

  • The first hash signature is generated for the manifest file itself.

  • The second hash signature is generated for the files referenced within the manifest.

This double-signing process ensures the integrity of both the manifest file and its referenced files, safeguarding against any tampering attempts.

Download Mage

Mage is included in the Windows Software Development Kit (SDK). The Windows SDK additionally contains SignTool and NuGet which may be used to sign other file types.

 

To install the Windows SDK:

  1. Download the Windows SDK.

  2. Run the winsdksetup.exe file that was downloaded.

  3. Follow the instructions in the wizard to complete the installation.

    提示

    Mage will be located in the file path: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools

Set PATH environment variable

Operating systems use the environment variable called PATH to determine where executable files are stored on your system. Use the PATH environment variable to store the file path to your signing tools to ensure that the CLI can reference these signing tools.

You can set the PATH environment variable to mage.exe using command line or environment variables.

To set the path to your signing tools via command line:

set PATH=%path%;<path to signing tool folder>

Command sample:

set PATH=%path%;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\

To set the path to your signing tools for your system or account:

  1. Search for environment variables in the Windows start menu.

  2. Select Edit environment variables for your account or Edit system environment variables.

  3. Double click on the Path variable.

  4. Click New.

  5. Select Browse.

  6. Select the path to the signing tool.

    Example: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\mage.exe

  7. Click OK to save the path.

  8. Click on OK to close the dialog.

Download and register KSP library

Mage integrates with DigiCert​​®​​ KeyLocker KSP library to sign.

Follow these instructions to download and register DigiCert​​®​​ KeyLocker KSP library.

Sign with Mage

You can sign with Mage directly or via DigiCert signing tools integrated with Mage: