Deploy your Synergy applications faster and easier with ClickOnce
By Marty Lewis, Systems Software Engineer
With version 9.5.3a of Synergy Language Integration for Visual Studio, you have a new option for deploying Synergy .NET applications: ClickOnce. ClickOnce makes deployment faster, easier, and more convenient than ever before. With ClickOnce, you can deploy an application straight from a web page in moments. All necessary runtimes and dependencies are seamlessly installed, and your application can be up and running very quickly.
Does this sound too good to be true? It isn’t. But there are a few requirements:
- Your development machine must have the following:
- Visual Studio 2010 or later with C++ installed
- Synergy/DE 9.5.3a or higher
- Synergy Language Integration for Visual Studio 9.5.3a or higher
- Target (deployment) machines must have either Synergy/DE 9.5.3a (or higher) or access to a Synergy license server via a named pipe.
Now that the requirements are out of the way, let’s dig in and get started with a whole new way to deploy your Synergy .NET applications. The process is simple enough. As long as you have a Synergy project with a few key options set, selecting “Publish ProjectName” from the Build menu will generate a setup executable that will do the job. Refining the process to make sure your deployments go to the right place and have the right information is where you will want to take some time and care during setup.
All of the options you need to set for this are centralized in the Project Designer (Project > ProjectName Properties). Start by opening the Runtime Settings page of Project Designer:
In this dialog, you can specify settings that will be used during runtime on deployment machines. If deployment machines do not have a license server, you will need to set the “Synergy License Server” field. With this field, you specify the name of the license server that will be accessed by the application runtime. If you have specific environment variables that need to be set in the target environment, specify their settings under “Runtime environment variables.” Variables specified here will be set during runtime initialization.
Note that all of the values on this particular dialog are read from and written to the App.config file in your project. So if it is more convenient, you can configure a basic App.config file and include it in your projects, rather than using this dialog for every project’s settings.
The next set of options you’ll need to consider control how your application is published and deployed (the web page used for publishing, how and where files are installed, and so forth). These are set from the Publish page of Project Designer:
This dialog is identical to the one you see when using ClickOnce in C#, so Microsoft’s ClickOnce documentation generally applies to ClickOnce for Synergy. But we’ll discuss a few basic options here that you should know about. (There are some differences with ClickOnce for Synergy. See the “ClickOnce Deployment (Synergy/DE)” topic, which is listed under “Synergy Language” in the help contents when viewing local Visual Studio help.)
To start with, you’ll likely need to change the “Publishing Folder Location” field after you establish any significant process with ClickOnce. This controls where the setup executable and distributable files are placed when they are published. It is powerful enough to allow access to ftp:// paths or most any path supported by your Windows OS.
Clicking the “Application Files” button opens a dialog where you can select which referenced assemblies, or other files in your project, should be distributed with the application. If you have additional projects in your solution that generate libraries referenced by this application, you should also select them in this dialog.
In order for your Synergy.NET applications to work correctly on a machine without a matching version of Synergy/DE installed, you also need to select “Include” from the dropdown list for synrnt.dll. This ensures that the Synergy Runtime library is deployed along with your application.
Back on the Publish page, click the Prerequisites button to bring up options for installing lower-level prerequisites for your application:
By default, the “Microsoft .NET Framework 4 Client Profile (x86 and x64)” option and the “Windows Installer 3.1” option are enabled. However, there is one more important prerequisite you need to select to make sure the Synergy Runtime will be able to run on the target machine. If a version of Synergy/DE is not already installed on the target machine, select the “Visual C++ 2010 Runtime Libraries” option that coincides with your target platform (x86 for 32-bit or x64 for 64-bit).
At this point, you have completed every setup step necessary to deploy a Synergy.NET application with ClickOnce. When you click “Publish Now” on the Publish page of Project Designer, Windows Explorer will open to the location of your published files (assuming your project builds correctly). And if you keep that hierarchy intact, you can copy the files to a web server or common network share. Once the project has been published, you can run the setup executable to quickly deploy prerequisites and necessary runtime assemblies and to launch your application, even on a machine without a Synergy installation.
There are more publishing options you can set: options that enable you to configure publisher information, file associations, automatic updates, and even a desktop shortcut for your applications. See http://msdn.microsoft.com/en-us/library/7azx932h.aspx for more information on this dialog, and see http://msdn.microsoft.com/en-us/library/t71a733d(v=VS.100).aspx for more information on ClickOnce deployment.
Learn more about this functionality, as well as other exciting new features in Synergy/DE 9.5.3, at the upcoming Synergy DevPartner Conference in May (Chicago) and June (York, UK).