Basically, I am trying to do this because I want an MSI install that can run with elevated privileges to install my application pre-requisites (e.g..NET Framework, database drivers etc.) and a bootstrapper executable that will launch the ClickOnce application which can be updated without elevated privileges. The atypical feature is that the child forms are loaded dynamically based on. When asked, I allow it to add the.deploy extension and override existing files.
Introduction ClickOnce applications do a great job of isolating applications from each other. This was done for two reasons, security and maintainability. Firstly, it allows for greater security since the.NET Framework manages security via code access policies. Secondly, it increases maintainability by preventing the problems with 'DLL hell'.
But this does pose a problem when one wants to launch the application. While it is installed on the hard drive, the framework installs it in different locations for every user. Microsoft solved this problem by creating a special type of shortcut, called an 'application reference' that is used in the start menu when a ClickOnce application is installed locally. Great, now we can launch an application from the start menu, but what if we want to launch it from another application? To answer this problem, I started where many of you are thinking. I will just use the URL to the.application manifest file on the server. Just do a System.Diagnostics.Process.Start on the URL and I am good to go.
While this will work fine in an always connected scenario, it doesn't work if the application needs to run in offline mode. For those applications, I suggest doing a little bit of thievery.
Since the application reference (.appref-ms) that is created in the start menu will launch the application (if it is installed) for any user on any computer (with the.NET Framework 2.0 installed), all we need to do is steal it out of the start menu and embed it in our launching application. This technique is useful for applications that run in an online/offline mode. For online only application, I suggest using just the URL. Shawn is an Orlando FL based developer and president of the Orlando.NET Users Group (Currently he is doing intranet & smart client development at a local fortune 500 company and teaches at the Florida Institute of Technology. Shawn started his career at his family business in Port St. Lucie Florida while working on his undergraduate degree in Business Administration at the University of Central Florida and after a year off Shawn moved to Orlando to pursue a Masters degree in Management Information Systems at UCF. Before graduating Shawn worked as an intern at the company he currently works full time for.
Currently Shawn is working on a second Masters degree in Computer Science at FIT. Besides his work, Shawn enjoys volunteering with local organizations. Member 4721536 15-Apr-08 1:46 15-Apr-08 1:46 install the application on a test machine from it's deployment url.
Open the application.reference file in the start menu using notepad, i.e: Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil You can jam that string into.any. programming language to start the process. For example: C: ShellExecuteA(0,'open','Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil',NULL,NULL,SWHIDE); VB6: Shell('Culture=neutral, PublicKeyToken=59a31195e50ec799, processorArchitecture=msil') etc etc.
Okay I got you now and it works pretty well. Might be clearer if you altered the article to indicate that the application reference is the shortcut found in C: Documents and Settings username Start Menu Programs Manfacturer Name ApplicationName.appref-ms The.appref-ms doesn't show and being a new file type on the system some might not have become aquainted with this type of shortcut/link file. Also one needs to be sure to add a reference to System.Diagnostics to use Process.Start(@'path to AppRef.appref-ms'); I used 'using System.Diagnostic;' in the form.cs file. Works well, cool idea I need to see how it can be further extended.
Thanks - modified at 8:07 Thursday 28th September, 2006. BillWoodruff 1-Jun-06 10:09 1-Jun-06 10:09 I appreciate your sharing your work, but I am left with a real sense of curiousity about what are the advantages or uses of launching a ClickOnce application in this way from another ClickOnce application. If you could say a little more about why you developed this, and what class of problems it solves, or what it facilitates, or makes possible, that would be appreciated. Best, Bill 'The greater the social and cultural distances between people, the more magical the light that can spring from their contact.' Milan Kundera in Testaments Trahis. This technique was designed after a client requested the ability to launch a click once application from another click once application. This technique is designed to meet this requirement.
The only way (to the best of my knowledge) too reliably, dynamically, launch an installed click once application, off line, is through this process, thus meeting the clients requirements. If your clients have this requirement then feel free to use this technique, but if they do not then you do not need this technique. Did this answer your question? Shawn Weisfeld President Orlando.NET Users Group.
'Did this answer your question?' Did you ever ask your 'client' why they required this? Did you explain to your client that ClickOnce publishing gives you the option to publish in an 'online-only' mode (no Start menu entry on your local machine) or in an offline mode (Start menu entry on your local machine, checks for updates when on-line, and automatically updates the app or its data files or resources automatically with some user prompting depending on settings).
![How to remove clickonce application How to remove clickonce application](/uploads/1/2/5/5/125558757/622637821.png)
Perhaps you are describing what is necessary to 'shell' an offline-only mode ClickOnce application remotely from another process? I assume, but have not personally tried, that you could make an offline-only ClickOnce app scriptable, set to startup automatically with Windows, subject to start-up by Windows Scheduler. Perhaps the last alternative would require your technique of 'de-referencing' the shortcut? Best, Bill 'The greater the social and cultural distances between people, the more magical the light that can spring from their contact.' Milan Kundera in Testaments Trahis.
I did explain the capabilities of ClickOnce to the client, but to the best of my knowledge this is the only technique to start a ClickOnce application from another ClickOnce application. There goal was to make a completely off line application that could be started from another completely offline application. Some might call this a ‘shell’, and this technique would be useful for scriptable situations. I am not sure you mean by ‘de-referencing’ the shortcut.
Shawn Weisfeld President Orlando.NET Users Group. Ahh, I understand now, you want to use my technique of launching a click once app from another click once app and you want to be able to pass the second app some information from the first application.
I don’t know of any way this is supported with click once. My guess is that you are going to have to resort to the traditional methods of inter-processes communication (i.e.
Write the information to a database table or file and have the new app read that when it launches, or send a message using WCF etc from one process to another, etc.).
Add-in Express™ for Microsoft® Office and.net Add-in Express ClickOnce solutions ClickOnce deployment for Add-in Express solutions Add-in Express adds the Publish Add-in Express Project item to the Build menu in Visual Studio. When you choose this item, Add-in Express shows the Publish dialog that generates the deployment manifest and places it into the Publish subfolder of the solution folder. In addition, the dialog generates the application manifest and places it to the Publish / folder. Then the dialog copies the add-in files and dependencies (as well as the Add-in Express loader and its manifest) to the same folder. See related videos:. One more file copied to the Publish / folder is called the Add-in Express Launcher for ClickOnce Applications or the launcher. Its file name is adxlauncher.exe.
This file is the heart of the Add-in Express ClickOnce Solution. The launcher is a true ClickOnce application. It will be installed on the user's PC and listed in the Start menu and Add / Remove Programs. The launcher registers and unregisters your add-in, and it provides a form that allows the user to register, unregister, and update your add-in.
It also allows the user to switch between two latest versions of your add-in. Overall, the launcher takes upon itself the task of communicating with the ClickOnce API. The launcher (adxlauncher.exe) is located in the Redistributables folder of Add-in Express setup folder. You can check its properties (name, version, etc) in Windows Explorer.
Subsequent Add-in Express releases will replace this file with its newer versions. And this may require you to copy a new launcher version to your Publish / folder. For your convenience, we recommend not using the asterisk in the tag.
Also, you should set the and AssemblyInfo tags before publishing the add-in. All this will be done when you publish the add-in. Finally, click on the Publish Add-in Express Project menu item to see the Publish dialog. On the development PC: publishing the add-in Publish dialog helps you create application and deployment manifests. In the current Add-in Express version, it shows the following form with the 'ClickOnce Deployment' tab: Step 1. Populating the application manifest Click Populate.
![Adding Adding](/uploads/1/2/5/5/125558757/654735646.gif)
This is the moment when all the above-mentioned folders are created and files are copied. To set a custom icon for the launcher application, you add a.ico file to the list and mark the file as Icon File in the Type column of the Files listbox.
How do I add additional files to the application manifest? The current release doesn't provide the user interface for adding additional files and/or folders. However, you can copy the files and/or folders required by your add-in to the Publish / folder and click the Populate button again. Specifying the deployment / update location You fill the Provider URL textbox with the target URL of your deployment manifest (originally, it is located in the Publish folder). For Web-site based deployment, the format of the URL string is as follows: Note. Must be entered in lower case. You can copy it from the Deployment manifest textbox in the Publish dialog window.
When debugging, you can create a Virtual Directory on your IIS server and bind it to the folder where your deployment manifest is located (the Publish folder is the easiest choice). In this case, the Provider URL could resemble this string: When releasing a real add-in, the Provider URL must specify the location of the next update for the current add-in version. You can upload version 1.0 of your add-in to any web or LAN location and specify the update location for this version. In subsequent add-in versions, you can use the same or any other update location.
For instance, you can use the same Provider URL in order to look for versions 1.0, 1.1, and 1.2 in one location and, when publishing version 1.3, specify another update location. Please note, that when the user updates the current version, he or she will get the most fresh add-in version existing in the location. That is, it is possible that the user updates from version 1.0 to version 1.3. The opposite is possible, too: this scenario requires the developer to publish v.1.3 and then re-publish v.1.0. Signing the manifests Browse for the existing certificate file or click New to create a new one. Enter the password of the certificate (optional).
Specifying preferences for a ClickOnce installation Click the Preferences button to open the following dialog window: In this dialog, you can choose if the ClickOnce module will get the OnShowCustomUI event, (it allows the add-in to show the custom or built-in UI), and specify the Support Location option for Add Remove Programs. The settings specified in the Preferences dialog can be used to publish the add-in from the command line; see. Choosing prerequisites When you click this button and select any prerequisites in the dialog, Add-in Express gathers the prerequisites you've chosen and creates a setup.exe to install them. Then you can upload the files to any appropriate location. When the user starts the setup.exe, it installs the prerequisites and invokes the ClickOnce API to install your add-in. Naturally, it may happen that some prerequisites can be installed by an administrator only.
In this case, you may want to create a separate setup project that installs the prerequisites only and supply it to the administrator. Publishing your Office add-in When you click the Publish button, Add-in Express generates (updates) the manifests. Manifest file names and locations Deployment manifest - /Publish/.application Application manifest - /Publish//.exe.manifest Now you are able to copy files and folders of the Publish folder to the deployment location, say a web server. Please note, for testing purposes, you can just double-click the deployment manifest.
Publishing a new version of the add-in In AssemblyInfo, change the version number and build the project. Click Publish and add the add-in files (Populate button). Fill in all the other fields. You can use the Version check box to switch to the data associated with any previous version. On the target PC: Installing, updating, uninstalling the add-in Installing: user perspective The user browses the deployment manifest (.application) in either Internet Explorer or Windows Explorer and runs the installation. The following window is shown: In accordance with the manifests, the ClickOnce loader will download the files to the and run the launcher application.
When run in this mode, it registers the add-in. If the host applications of the add-in are running at this moment, the user will be prompted to close them. If the user clicks Cancel, the launcher will be installed, but the COM add-in will not be registered. However, in any appropriate moment, the user can click the launcher entry in the Start menu to run the launcher and register/unregister the Office add-in through the launcher GUI. The current Add-in Express version relies on the name and location of the product entry in the Start Menu. Please, add this information to your user's guide.
Installing: developer perspective If a ClickOnce module (ADXClickOnceModule) is added to your add-in project, you are able to handle all the actions applicable to add-ins: install, uninstall, register, unregister, update to a newer version, and revert to the previous version. For instance, you can easily imagine a form or wizard allowing the user to tune up the settings of your add-in. The ClickOnce module also allows you to show a custom GUI whenever the launcher application is required to show its GUI. Please note that if you don't process the corresponding event, the standard GUI of the Add-in Express ClickOnce application will be shown. You can also make use of the ComRegisterFunction and ComUnRegisterFunction attributes in any assembly listed in the loader manifest (see assemblyIdentity tags). The methods marked with the ComRegisterFunction attribute will run when the add-in is registered. See MSDN for the description of the attributes.
Updating the add-in: user perspective The user can check for add-in updates in the launcher GUI (or in the GUI you supply). To run it, the user clicks the entry in the Start Menu. If there is no update in the update location specified in the deployment manifest, an information message box is shown.
If there is an update, the launcher requests the user to confirm his/her choice. If the answer is positive, the ClickOnce Loader downloads new and updated files to the, the launcher unregisters the current add-in version, restarts itself (this will run the launcher application supplied in the update files), and registers the add-in. Updating the add-in: developer perspective The add-in module provides you with the CheckForUpdates method. This method may have the following results:. The add-in becomes updated. The ClickOnce module invokes the OnError event handler Uninstalling: user perspective To uninstall the add-in, go to Add Remove Programs and clicks on the product name entry.
This will open the following dialog:. Restore the application to its previous state This option is disabled, if the add-in was never updated. If the user chooses this option, the launcher will run, require the user to close the host applications of your add-in, unregister the add-in, requests ClickOnce API to start the launcher application of the previous add-in version, and quits.
Then the launcher application of the previous add-in version registers the add-in. Remove the application from this computer This runs the launcher that will require the user to close the host applications of your add-in. Then the launcher will unregister the add-in and request ClickOnce API to delete both the add-in and the launcher files. Uninstalling: developer perspective Handle the corresponding event of the ClickOnce module or use the ComUnRegisterFunction attribute to run your actions when the add-in is unregistered. In the Web-based deployment scenario, the user can install an Office extension using Internet Explorer only. The from Wikipedia states that Firefox allows ClickOnce-based installations too, but this was neither tested nor even verified. This technology is now available for our custom development services only.
Based on the Add-in Express for Office core, it is designed for building custom-tailored Office add-ins with far less coding than you usually have to do. Plus, it includes all Add-in Express features such as True RAD, visual designers, Outlook view and form regions, etc.
Extensions: VSTO-based application-level Office add-ins Applications: Outlook, Excel, Word, PowerPoint, Visio, InfoPath Office versions: 2003, 2007, 2010 (x86 and x64) IDE: VSTO 2005 SE, 2008, 2010; VB.NET, C#. Designer for Visual Studio® and WiX Toolset This is an extension for Visual Studio that allows developers to quickly create WiX-based setup projects in a familiar Visual Studio way.
The Designer for WiX Toolset lets you forget the plain Windows Installer XML and concentrate on your deployment logic. It integrates several editors with the Visual Studio IDE and provides a set of vdproj designers to configure the file system, registry, user interface, custom actions, launch conditions and more for your setup projects. This technology is now available for our custom development services only. This visual toolkit allows creating secure, managed, isolated, deployable and version-neutral plug-ins for Outlook Express and Windows Mail.
It provides powerful solution templates, Outlook Express - specific components, visual designers and wizards for advanced customization of Outlook Express menus, toolbars, panes and regions. Extensions: Outlook Express plug-ins Versions: Outlook Express 6.x, Windows Mail 6.x IDE: VS 2005, 2008; VB.NET, C#, C/CLI.