JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Confused about patching.

I have built an EXE to install a series of MS XL files. I now have a situation where one or two of the 10 XL files will need to be updated, this is because the other 8 XL files will contain running data which needs to be preserved.

So, what method do I use so that my user can update the one or two XL files (Patching, Versioning, Automatic Patching, etc)?

I intend to send the updated files to each user via an email. I do not want more than one copy of the XL files installed on any PC. Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Confused about patching.

Hello,

Here are a couple of articles that describe using patches and to help you with an overall upgrade comparison:
http://www.advancedinstaller.com/user-g ... tches.html
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

In case you are only changing a few files, then the recommended way would be a patch project. Here is the tutorial to help you get started with authoring patches:
http://www.advancedinstaller.com/user-g ... patch.html

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Confused about patching.

Thanks Mihai,

But I do not understand what I need to do. Here's what I have:

I have an Enterprise project which contains a number of XL files. I have the following options set in Media:

Media
Media\Package-
Folder: C:\Users\Julian\Documents\MyCompany\Sure Project\FileSystem- XL2007\Notification Setup Project\Source Packages\Office 2007 refs, shortcut in Startup folder\Setup Packages
Filename: [|ProductName] Full Setup

Archive-
Archive installation files using LZMA compression for smallest package size

Media
MSI\Files Schema-
Adaptive

Database Code Page-
Build language specific codepage

Media
Bootstrapper-
X Create EXE setup file

Display-
File Name: [|ProductName] Setup V[|ProductVersion]
Icon File: .......

Package-
X Include install files in EXE


So, my project creates an EXE setup app which we use to install the base application onto the target PC. What I now need to do is to create a patch app which will only copy two XL files which change on a regular basis.

I created a patch app in AI, but I do not know what to do in the Images Project Definition. If I click the New Upgraded button, it asks for an MSI file- but what MSI file? I do not have one. So how do I include the two new XL files into the patch so that when the patch is run, it installs just those two files on the target PC replacing the existing files?
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Confused about patching.

Hello,
I created a patch app in AI, but I do not know what to do in the Images Project Definition. If I click the New Upgraded button, it asks for an MSI file- but what MSI file? I do not have one.
To create a patch you will need both target and upgraded .MSIs. If you have the "Include files in EXE" option set, then to extract the .MSI from the .EXE you can use the following bootstrapper command line:

Code: Select all

/extract <path>
This command line extracts the .MSI contained by the .EXE to the specified location. If the path contains spaces you must enclose it in quotes.
So how do I include the two new XL files into the patch so that when the patch is run, it installs just those two files on the target PC replacing the existing files?
Just to clarify things, here are the generic recommended steps you can follow in case of a patch:
- back-up of the AIP of the first installation
- open the AIP of the first installation in Advanced Installer
- in the "Product Details" page increase the version (in the "Product Version" field)
- after you select another page you are prompted about changing the Product Code
- in this dialog select "No" because the target and upgraded packages must have the same product code
- update the package (add/modify files, registry keys etc.)
- make sure that nothing is removed
- save and build the project (the target and upgraded packages must have the same name, for example: "test.msi")
- in Advanced Installer create a Patch project
- set the target (old MSI) and the upgraded (updated MSI) packages
- build the project

As the patching process requires careful settings not to mention specific rules, to understand the basic concept and to avoid any future confusions, I recommend you first follow our tutorial before implementing the functionality into your main project.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Confused about patching.

OK. After extracting the MSI (and all the other files which came with it) from my setup.exe V2.0.12 14,661 KB and V2.0.13, 14,664 KB, I ended up with two MSI files. The V2.0.13 MSI was set as the Upgraded image and V2.0.12 was set as the Target image. The resulting Patch.msp file was 40 KB. So what is actually stored in the patch file?

Anyhow, I tried the patch on a V1.9.5 installation of my app on my test PC and it says "The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing......". Are you telling me that the patch can only be used on a PC where only V2.0.12 of my app is installed???

Furthermore, I installed V2.0.12 on my test PC and I tried the patch file (V2.0.12) and it started copying new files and came up with a dialog stating:

The feature you are trying to use is on a network resource that is unavailable.

And it gives me the ability to browse for the installation package "MyPackage Setup.msi" but I do not have such a file on the target computer!


Is there any way to create a patch EXE which looks at the installed files on the target PC, determines which files in the patch container are different, and ONLY copy those files from the patch to the PC? It is really a simple request.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Confused about patching.

Hello,
The resulting Patch.msp file was 40 KB. So what is actually stored in the patch file?
Are you telling me that the patch can only be used on a PC where only V2.0.12 of my app is installed???
Usually our support team links references to relevant articles from our user guide in blue text. As mentioned in the first paragraph from the Patch section of the link I sent in two of my previous posts:
"Patches are usually much smaller than upgrades, as they only contain the diffs between the two versions of the product. However, they can only be installed on computers that have the previous version already installed."
The feature you are trying to use is on a network resource that is unavailable. And it gives me the ability to browse for the installation package "MyPackage Setup.msi" but I do not have such a file on the target computer!
From the same article still:
"Note that, when applied, the patch will request the original MSI package (because, by default, the bootstrapper deletes the extracted files). In order to avoid this problem, select the option "Do not delete extracted MSI and CAB files" in the Media page, "Bootstrapper" tab. "
When authoring .EXE packages, you are using the Advanced Installer bootstrapper.
Is there any way to create a patch EXE which looks at the installed files on the target PC, determines which files in the patch container are different, and ONLY copy those files from the patch to the PC? It is really a simple request.
There is no such upgrade functionality available with Windows Installler. Deducting from this post I believe an upgrade would better fit your demands:
http://www.advancedinstaller.com/user-g ... oduct.html
http://www.advancedinstaller.com/user-g ... rades.html

Before changing your project, I strongly recommend you carefully read the Windows Installer available upgrade scenarios and how they apply:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Implementing the exemplified basic functionality from our user guide articles in test projects can help you better understand these concepts.

Let us know if you have any questions.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
JDMils
Posts: 50
Joined: Tue Aug 10, 2010 12:42 pm

Re: Confused about patching.

I think I'm getting there with the Patch method- I just need to keep testing and get my head around it. How can I extract the MSI from the EXE to a specific subfolder using the command line?

The reason I ask this is that my installation packages are all EXEs with the product version number in the filename, so I need to extract the MSI to a subfolder named the same as the version number. So:

MyHealthNode System Setup V2.0.17.exe

Needs to have its MSI extracted to a sub folder called "2.0.17". If I can figger out what the command line is for this I can then automate it using a quick VB.Net utility which I can write myself. Thanks.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Confused about patching.

Hi,

Here is the user guide article that explains the bootstrapper proprietary command lines and their usage.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”