8 min read

Using ClickOnce to Deploy the Microsoft Dynamics NAV 2013 RoleTailored Client for Windows

In Microsoft Dynamics NAV 2009, the RoleTailored client could only be deployed using a standard Windows Installer (.msi). While this is a common scenario, .msi-based deployment requires the partner to do customer visits, do remote logons, or educate the customer’s IT administration to install the Windows client and any additional add-ins, change any client-side settings, or upgrade the client (manually or through group policy).

This approach does not scale well in on-premise solutions that have a lot of users or in volume Azure or syndication scenarios when the Windows client is needed rather than a Web client for deeper functionality or better performance.

Thus, in Microsoft Dynamics NAV 2013 a new way of deploying the Microsoft Dynamics NAV Windows client, using ClickOnce, has been introduced, providing benefits such as:

  • Creating zero end-user configuration deployments for the Microsoft Dynamics NAV Windows client, for example, pushing out a predefined ClientUserSettings.config file directly, as well as pushing out changes to this.
  • Updating the client without the user having to do anything but run the usual client.
  • Co-deploying any partner created additional add-in assemblies.
  • Side-by-side installation, for example, test and production clients, including different versions.

These benefits allow for a more streamlined and centralized deployment of the Microsoft Dynamics NAV Windows client in high volume scenarios such as Azure.

In this blog post we’ll dig a bit into ClickOnce, the end-user and partner experiences, and the benefits and current limitations of deploying the Microsoft Dynamics NAV 2013 Windows client using ClickOnce. In other blog posts about implementation, we’ll dive into the technical details around how to actually create a ClickOnce application for the MIcrosoft Dynamics NAV 2013 Windows client.

ClickOnce Overview

ClickOnce is a standard deployment technology — starting with .NET Framework 2.0 — that allows you to create self-updating Windows-based applications that can be installed from a Web server or network file share and run with minimal user interaction. It addresses three major issues in deployment:

  • Ability to detect and update to a newer version
  • Running as a self-contained application, allowing side-by-side installations
  • Not requiring administrative permissions to install

In use, ClickOnce is basically a configurable file copy from a repository to the client machine that, at a high level, consists of three parts:

  • A folder structure with application files, in our case, the files that make up the Microsoft Dynamics NAV 2013 Windows client. Different versions are put in different root application folders. All versions are then put on a file share or web/cloud storage. 
  • An xml application manifest that describes files to install for a given application version, the main file to execute, and so forth. There is one manifest per version of the application, located in the application root folder.
  • An xml deployment manifest that describes which version to install along with application metadata, for example, name, icon, upgrade policy, and so forth.

With the above created, the application can be installed by the end user by running the deployment manifest. Typically, this is accomplished by hosting the above files and providing a link to the application and deployment manifest to the end user, for example, on a landing page or in an email message, after the user has signed up for a solution and required a client to be installed.

For more information on ClickOnce, see ClickOnce Security and Deployment in the MSDN Library.

The End-User Experience

To install Microsoft Dynamics NAV 2013 using ClickOnce deployment, the end user will choose the link to the application, the deployment manifest, that is provided in a landing page or email message. The link may point to a file share or a website. Using the .NET Framework on the client machine, the ClickOnce runtime runs the linked deployment manifest and opens with a confirmation dialog box, such as the dialog box shown in the following illustration.

If the user chooses the Install button, ClickOnce downloads all the necessary files to a local folder on his computer. This folder is a per user folder, located in the ClickOnce generic application cache for the user: <user>\AppData\Local app folder), not in the standard Program Files folder.

When the installation is complete, ClickOnce installs a program shortcut on the Start menu and starts the Microsoft Dynamics NAV 2013 Windows client, using the connection settings provided as part of the installation. No configuration is needed during or after installation as this is set up as part of the ClickOnce Windows client application.

The next time that the end user wants to run the Windows client, he can either select the link again, or he can select the shortcut on the Start menu. In either case, ClickOnce will check if there is a newer version available, which the user will have the option to install.

The Partner Experience

To create a ClickOnce deployment of a Microsoft Dynamics NAV 2013 client with settings, add-ins, and so forth, the typical process for a partner is to:

  1. Create a base Microsoft Dynamics NAV Windows client installation, that is, actually install the client using the .msi installer, with needed languages, and so forth.
  2. Add any additional partner developed add-in assemblies.
  3. Modify the clientusersettings.config file to fit the end-users’ case.
  4. Build and sign application and deployment manifests.
  5. Test deployment.
  6. Upload all files to a repository (web, hosted storage or file share).
  7. Create a landing page, email message, or similar and provide a link to a customer’s users so that they can just click and run the deployment manifest. ClickOnce takes care of the rest.

The above process will typically take 30-60 minutes to set up the first time. Repeating this process on changes in low fluctuating on-premise installations makes sense. In the case where the same vertical solution and Windows client setup is to be used by multiple different customers, the clientusersettings.config file will be different, it is better to streamline the above process by creating a script for creating the basic customer-agnostic client installation, and then inject clientusersettings and recompile and sign on the fly.

As mentioned, in other blog entries we’ll dig into the technical steps on how to set up a ClickOnce deployment. See also the Help topic Deploying Microsoft Dynamics NAV Using ClickOnce in the MSDN Library.

Benefits of a ClickOnce Deployment of the Microsoft Dynamics NAV 2013 Windows Client

ClickOnce deployment resembles traditional Windows Installer-based deployment. In addition to .msi-based deployment functionality, ClickOnce provides the following benefits:

  • Seamless upgrade: End users will not notice when the Microsoft Dynamics NAV RoleTailored client is upgraded. There is also very minimal user interaction, such as applying a hotfix.
  • Centralized configuration: The configuration file that is installed with the Windows client contains several settings that must be adjusted for the specific installation, such as the server address and the authentication type to use. By using ClickOnce, you can control the ClientUserSettings.config file centrally and push it out to the client computers. Configuration is not required on the individual client computer. If you make a mistake, or if the settings have to change, for example, because you want to move the Microsoft Dynamics NAV Server to a different computer, then you can create an updated configuration file and push it out to users by using the upgrade capability.
  • Co-deploy of bundled add-ins: By using ClickOnce, you can easily deploy your own assemblies and third-party add-in assemblies. You do not have to copy add-in files after the installation.
  • Side-by-side installations: You cannot have two .msi-based Microsoft Dynamics NAV Windows clients on the same computer. A ClickOnce-deployed Windows client does not interfere with other ClickOnce-deployed Windows clients. This makes it easy to run ClickOnce against different servers from the same computer. For example, you could have two Windows client installations, one for a production server and one for a test server. This also means that you can run different versions of the Windows client side-by-side, which is not possible with Windows Installer
  • Multi-languages deployed: Multiple languages can be included in the same installer. By using ClickOnce, you can decide which files, such as language resource files and Help files, that you want to include in the deployment. End users will not be aware of the difference between installing an EN-US-only version and a version with different languages.
  • Non-administrator installation: By using ClickOnce, a regular Windows user can install the Windows client; administrator permissions are not required. Note, however, that the prerequisites for installation require administrator permissions. These have to be installed one time on the computer, after which any user can install and upgrade the Windows client.

The result is that end users can install the Windows client without relying on partners or super users to do it for them.

Using Windows Installer vs. Using ClickOnce

A ClickOnce-deployed Windows client has some limitations compared to the Windows client installed by the Windows Installer. These limitations are not a technical shortcoming of the ClickOnce framework, but a scoping of the provided support in Microsoft Dynamics NAV 2013, based on what we expect the typical usage of ClickOnce for deployment to be. The following are the limitations:

  • Command-line arguments — ClickOnce installed on the Microsoft Dynamics NAV client cannot be run with custom command-line arguments. For example, this affects the following scenarios:
    • An end user cannot specify the Home page.
    • An end user cannot specify a profile. He can only use his default profile.
    • An end user cannot disable personalization. An administrator can disable personalization on a profile.
    • An administrator cannot configure profiles. He should use the .msi-installed client for this task.
    • An end user cannot run in full-screen mode.
    • An end user cannot disable the navigation pane.
  • Hyperlinks — The protocol handler dynamicsnav:// is not registered during ClickOnce installation, which means that the Microsoft Dynamics NAV client cannot be activated by choosing a hyperlink. This could impact the following scenarios:
    • End users cannot send each other links to specific pages.
    • An end user cannot use the link on a OneNote page.
    • An end user cannot use the link on a report.
  • External components calling the Microsoft Dynamics NAV Windows client — A ClickOnce-installed Windows client will be installed in a randomly generated folder, and when it is upgraded to a new version, it will be installed in a new randomly generated folder. This means that external components will not be able to detect where the Windows client executable is located. This could impact the following scenarios:
    • An end user can send a list page to Excel, but cannot refresh data from the Excel application (because the Excel integration relies on locating the client to get to server through the client’s ClientUserSettings.config file).
    • Third-party applications cannot start the Windows client.

If any of these limitations is an issue in the given deployment scenario, and the benefits of the ClickOnce deployment scenario do not outweigh this, the guideline is to use the standard Windows Installer-based Microsoft Dynamics NAV Windows client deployment instead.

The following table provides a summary of the value proposition for Windows Installer and ClickOnce:

Coverage Windows Installer ClickOnce
Stream deploy over the web No Yes
Upgrade No Yes
Installation location Program Files Per user, per app cache
Install prerequisites Yes Check only
Access to Windows registry Yes No
External integration to client.exe (for example, app links using protocol handler, or refresh in Excel add-in) Yes No
Client.exe command line parameter support Yes No
Co-deploy/bundle additional add-in assemblies No Yes
Side-by-side (test and production versions) No Yes
Centralized administration/co-deploy ClientUserSettings.config No Yes
Deploy multiple client languages in one go No Yes

 -Peter Borring Sørensen