Building on Windows

Types of build

In Monaca, Electron applications have two types of build: debug and release. The differences between these types of build are as follows:

Type of Build

Description

Debug Build

DevTools are shown by default when the application is launched. It can be closed or opened manually.

Release Build

There are no DevTools.

The built package is unsigned. You might need to manually sign the package after downloading.

Step 1: Configure the app

  1. From the Monaca Cloud IDE menu, go to Configure → App Settings for Windows.

  2. Fill in the app information:

    • Application information:

      Setting

      Description

      Application Name

      The application name

      App ID

      A unique name which will be used when uploading to the Store. It is recommended to use the reverse-domain style (for example, io.monaca.app_name) for app ID. Only alphanumeric characters, periods (at least one period must be used) and underscore are allowed. Each segment should be separated by a period and started with an alphabetic character.

      Version Number

      The version number of your app. A version number consist of numbers separated by dots (for example, 1.0.0)

      Application Description

      The description of your application

    • Application Icon

      Set an application icon as a PNG. The icon should be at least 512x512 pixels to work across all operating systems.

  3. After finishing the configurations, click Save.

Step 2: Build the app

  1. From the Monaca Cloud IDE menu, go to Build → Build App for Windows.

  2. Select the type of build you want and click the Start Build button. The windows release build supports the following build packages:

    Package

    Description

    nsis

    Generates an NSIS (EXE) installer.

    zip

    Packs everything into a zip file.

Release Build

There is no build package option for the Windows debug build. The default package is zip.

Debug Build

3. It may take several minutes for the build to complete. Once the build is completed, your application is ready to be downloaded.

Step 3: Install the app

ZIP package

Run the executable file

  1. Extract the downloaded zip file.

  2. Double click on the executable file. There might be a dialog asking for confirmation before running the application. If so, click More info.

3. Click Run anyway.

Sign the executable file

Before proceeding, make sure you have the following prerequisites.

  1. Windows Software Develoment Kit (Windows SDK). Please download it from the Microsoft official page. If you are using Windows 10, you can download from this link.

  2. Signing Certificate.

We will be using the SignTool command to sign the executable file (exe). SignTool is included when you install Windows SDK. To sign a file, you just need to open the Command Prompt and run:

signtool sign /f MyCert.pfx /p "MyPassword" "MyApp.exe"

For more information of how to use the SignTool command, please refer to the official documentation here.

Signing a file

To verify whether a file is signed, you can run:

signtool verify /pa /v "MyApp.exe"
Verifying whether a file is signed

NSIS (EXE) Installer

Install the application

  1. Download the NSIS (EXE) file.

  2. Double click on the executable file. There might be a dialog asking for confirmation before running the appliation. If so, click More info and then Run anyway.

3. The application is installed to your default installation path.

Create an MSIX package

Before proceeding, please make sure you have the following prerequisites.

  1. MSIX Packaging Tool. You can download it from the Microsoft official page. If you are on Windows 10, you can download from this link.

  2. Signing Certificate

You can use the MSIX Packaging Tool to create an MSIX application package from an existing EXE installer. You can refer to the official Microsoft guideline. To use the tool, follow the instructions below:

  1. Open the MSIX Packaging Tool and choose Application Package.

2. Browse and choose the downloaded NSIS (EXE) file and check the box under Sign package and browse and select your .pfx certificate file. If the certificate is protected, type the password in the password field.

3. Choose the first option Create package on this computer.

4. Fill in the required information. The Publisher name will be automatically filled from the uploaded certificate.

5. Next, go to the Prepare computer page that provides options to prepare the computer for packaging. The MSIX Packaging Tool Driver is required and the tool will automatically try to enable it.

6. In the Installation page, the tool will test the installer by trying to install the application on your computer.

7. On the First launch tasks page, the entry point should be automatically populated in the list. If it is not, please click the Browse button and select the entry point executable file.

8. Specify the location you would like to save the MSIX package.

9. It might take up to several minutes to create the package. After it is done, it should display something like this:

Tested environments

  • Windows 10 Pro, Version 1803, OS build 17134.885

  • Windows Software Development Kit - Windows 10.0.18362.1

  • MSIX Packaging Tool - Version 1.2019.701.0