Click here to Skip to main content
Click here to Skip to main content

Deploying CAB Files Using ClickOnce Deployment

, 25 Sep 2008
Rate this:
Please Sign up or sign in to vote.
This article is a step by step explanation of how to modify a ClickOnce Deployment package to include CAB files

Introduction

The purpose of this article is to demonstrate how to modify a ClickOnce Deployment Application Manifest to include CAB and other resource files normally not permitted through ClickOnce.

Background

Suppose you have a Visual Studio 2005 or 2008 project that contains a CAB file and you wish to include that CAB file as part of your ClickOnce Deployment package. By default, there is no way in Visual Studio 2005 to do this. Thankfully, there is an Open Source Utility called “Manifest Manager Utility” available which can be used to do this.

Details

Step 1 – Manifest Manager: Download the “Manifest Manager Utility” source code from the following URL:

Extract the zip file and open the solution file “ManifestManagerUtility.sln” in Visual Studio and compile the code to generate the “ManifestManagerUtility.exe” file. Alternatively, you can use the Windows Installer I have included in this tutorial to install a compiled version of this utility on your machine.

Step 2 – Sample Project: The sample project I have included in this tutorial consists of the following subprojects:

  • ClassLibrary1: is a sample Class Library DLL, which we wish to distribute with our ClickOnce Deployment.
  • Sample Project 1: is the main subproject of the solution, which is set as the startup project for our solution.
  • Cab1: is a CAB Project, which takes the primary output from ClassLibrary1 and adds the DLL to the output of the solution.

Step 3 - Right-click on the main subproject name (in this case “Sample Project 1”) in the Solution Explorer window in Visual Studio and Choose “Properties”.

002_Initial_Publishing_ClickOnce_Deployment_Package.jpg

Step 4 – Click on the “Publish” Tab and enter the “Publish Location” and “Install URL” of your application. This can either be a web location, a shared network location, or a location on your local machine.

Step 5 – Click on the “Publish Now” button to publish your application. Here is what you will have in your directory:

003_Initial_Published_Files.jpg

Step 6 – Run the Manifest Management Utility and click on the “Open” folder icon:

004_Open_Application_File.jpg

Step 7 – Select the .application file of your ClickOnce Installer and click on the “Open” button:

005_Select_Application_File_to_modify.jpg

Step 8 – Click on the “Add Files” button in the toolbar.

006_Click_on_Add_Files_Button.jpg

Step 9 – Navigate to the project directory and select the CAB file you wish to include with your ClickOnce Deployment to add. You will be asked about the destination of the CAB file. Select the subfolder “Sample Project 1_1_0_0_0”, inside the same folder you opened the “.application” file from. Here is what your screen should look like:

007_Manifest_Manager_with_CAB_File.jpg

Step 10 – Click the “Save” button to save your changes. You will be asked to provide the Key (Digital ID / Authenticode) for the application. By default, when you first publish your application, a Key is created for you and added to the source code folder of your project. Click the “Browse” button and navigate and select this Key file. Here is what your screen should look like:

008_Selecting_the_Key_File.jpg

Step 11 – If you have a password associated with your Key file, enter it in the password Textbox. Otherwise leave the password field empty and click on “Save and Sign” to complete your modification.

Step 12 ­­– Navigate to your “Sample Project 1_1_0_0_0” folder, you should see an additional file called “ClassLibrary1Cab.CAB.deploy” added to your list of deployment files. This file is basically your original CAB file with a “.deploy” added to the end of it to allow ClickOnce to deploy it along with your other files to the user’s machine.

That’s it! All you have to do now is to upload the files to your web server, shared network folder or deployment location and run the ClickOnce installer to watch it do its magic.

Points of Interest

Feel free to post questions or comments regarding the above tutorial below in the comments section, and don’t forget to rate the article!

History

  • 09/26/2008 - Initial article creation

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

DigiOz Multimedia
Software Developer (Senior) DigiOz Multimedia
United States United States
Pete Soheil is the Creator and Owner of DigiOz Multimedia, a Chicago-IL based company that specializes in the creation of Windows, Web and Mobile Application Development in a variety of Programming Languages, including C#, VB.NET, ASP.NET, ASP, VC++, GCC, PHP and Perl.

Comments and Discussions

 
QuestionLittle bug Pinmemberkonytskyy18-Jan-12 3:06 
GeneralDoubt Pinmembercarlosae23-Mar-09 4:33 
GeneralRe: Doubt PinmemberDigiOz Multimedia23-Mar-09 16:29 
GeneralRe: Doubt Pinmembercarlosae24-Mar-09 2:44 
GeneralRe: Doubt PinmemberDigiOz Multimedia25-Mar-09 4:17 
QuestionWhy? PinmemberMahdi Manavi4-Feb-09 21:25 
AnswerRe: Why? PinmemberDigiOz Multimedia5-Feb-09 1:58 
GeneralRe: Why? PinmemberMahdi Manavi5-Feb-09 5:20 
GeneralRe: Why? PinmemberDigiOz Multimedia5-Feb-09 5:32 
GeneralRe: Why? PinmemberMahdi Manavi6-Feb-09 21:13 
GeneralRe: Why? PinmemberDigiOz Multimedia7-Feb-09 3:26 
GeneralRe: Why? PinmemberMahdi Manavi7-Feb-09 4:40 
GeneralRe: Why? PinmemberDigiOz Multimedia7-Feb-09 9:10 
GeneralI don't get a pfx file generated PinmemberDavid Fenstemaker29-Sep-08 10:55 
GeneralRe: I don't get a pfx file generated PinmemberDigiOz Multimedia29-Sep-08 11:03 
GeneralThanks PinmemberVaako28-Sep-08 22:22 
GeneralRe: Thanks PinmemberDigiOz Multimedia29-Sep-08 4:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 26 Sep 2008
Article Copyright 2008 by DigiOz Multimedia
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid