PDA

View Full Version : Quick patch



fniles
01-26-2004, 06:39 PM
I am using Installshield express version 4.0 SP 1.
I created an update patch, but when I installed it, it says "The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch."

What is usually the cause of this error?
We created our software version 8.2, and then we created the upgrade patch. This is not the first time we created upgrade patch for version 8.2. Everytime I need to create a new upgrade patch, do I need to create a new quickpatch project, or can I just go ahead and build the existing upgrade patch project?

Is it ok after creating an upgrade patch to rebuild the installation for version 8.2 (so that for new users, they don't need to install 8.2 and all the upgrade patches)?

If I do this, next time I want to create upgrade patch, will it work?

Thank you very much for your help.

DebbieL
01-27-2004, 12:57 PM
Let's say that you create an installation for version 8.2 and then created Patch1. So end users may have V8.2,Patch1 installed on their systems.

Then you create Patch2. When you create this patch, are you basing it on the original installation (version 8.2), or are you basing it on Patch1? If you base it on version 8.2, then end users who have V8.2,Patch1 may not be able to use Patch2. They may receive the Windows Installer error message that you provided.

You also asked the following: "Is it ok after creating an upgrade patch to rebuild the installation for version 8.2 (so that for new users, they don't need to install 8.2 and all the upgrade patches)?"

It is not recommended that you do this. If you open and modify any of the releases that are selected in the History view of your QuickPatch project, your latest QuickPatch project will not work, since intermediate data shared across the releases in the History view may have been lost or altered.

Whenever you build a QuickPatch project, InstallShield Express creates an UpdatedImage folder in your QuickPatch project folder. This folder contains the latest version of your uncompressed installation. If you want to update your installation for users who have not installed the previous version of your installation, the installation in this folder is the one that you should distribute to them. The file size is much larger than your patch because it contains the entire installation, not just the elements that have changed between versions.

Following is more general info about QuickPatch projects in Express. Hopefully, it will help you understand how they work.

How Windows Installer patching works
=============================
When you run your installation on a machine, Windows Installer will cache that installation's .msi file on the local machine. By default, this .msi is cached in [WindowsFolder]Installer. The .msi file is renamed with a random name (like sc253nh.msi for example). Whenever the machine needs to check the status of this installation, it will look in this cached .msi file. When you perform a "Repair" operation from Add and Remove Programs, Windows Installer looks in this cached .msi and makes sure that everything specified in this .msi is properly installed on the machine. If somethig is missing, it will correct it. So theoretically, if you open this cached msi file in Orca, add a new entry in the Registry table, and perform a Repair, it will should create this new registry entry.

Applying a patch literally updates this cached .msi package and then performs a repair of the installation. This causes the system to now have stuff as specified in the updated cached .msi file. So in other words, your installation takes the "form" or "state" of what is defined in the cached .msi. Applying another patch on top of this will once again alter the cached .msi and reform the system to match it. This means that a patch cannot be rolled back. When the installation is uninstalled, it uninstalls everything mentioned in this cached .msi. causing even stuff added through patches to get uninstalled.

QuickPatch
=========
To understand how QuickPatch projects work in Express, let's look at an example\tutorial:

Preparation:
Create three text files with the same name (test.txt) and put them in different folders. Put the line "Version 1.0" in one file, "Version 2.0" in one and "Version 3.0" in the other one.

Steps:
1. Launch Express and create a new project (Setup1).
2. Add the Version 1.0 test.txt file to INSTALLDIR.
3. Build.
4. Create a QuickPatch project off this build from Tools->Create a QuickPatch (Patch1).
5. Increase the Product Version in General Information View.
6. Open the Files view.
7. Configure the patch to replace test.txt with the file that has the text "Version 2.0."
8. Build.
9. Create a QuickPatch of Patch1 by going to Tools->Create a QuickPatch while Patch1 is open in Express.
10. We'll call this Patch2.
11. Increase the Product Version in General Information View.
12. Go to Files view.
13. Configure the patch to replace test.txt with the file that has the text "Version 3.0".
14. Build.

Runtime:
1. Install Setup1 and then apply Patch1 -> Should have Version 2.0 test.txt file.
2. Install Patch2 -> Should have Version 3.0 test.txt file.
3. Uninstall Setup1 from Add/Remove Programs -> Should uninstall test.txt.
4. Install Setup1 and then apply Patch2 -> Should have Version 3.0 test.txt file.
5. Uninstall Setup1 from Add/Remove Programs -> Should uninstall test.txt.
6. Run Patch1 WITHOUT running Setup1 -> Should give an error saying the product to patch is not installed.
7. Run Patch2 WITHOUT running Setup1 -> Should give an error saying the product to patch is not installed.

Conclusion:
By default, when you create QuickPatches of QuickPatches, Express automatically creates patches that collect information of previous patches. So suppose you distributed version 1.0 as an installation and then released 4 patches that upgrade the installation to versions 1.1, 1.2, 1.3 and 1.4. By default, applying the 4th patch you create will upgrade ALL previous versions to 1.4.

You CAN change this behavior (if you wanted to). In the tutorial/example I gave, open the Patch2 project in Express. Go to General Information->History. You will see three entries with check boxes. By default they are all selected. If you clear the middle check box (the entry for Patch1) and rebuild Patch2, applying Patch2 on top of a machine with Setup1 and Patch1 (step 2 in the Runtime section avove) will fail.

Debbie
InstallShield Software Corporation

fniles
01-27-2004, 01:47 PM
Thank you very much for your reply and information. It's great.
Pls let me know if I understand it correctly. So, once I already release version 1.0, and I have patch 1.1, 1.2, and 1.3, any new client needs to install version 1.0, then 1.3, right? I can't just give them 1 installation that contains the whole thing, right?

If version 1.1 and 1.2 have file a and b respectively, and version 1.3 has file c, will installating version 1.0, then 1.3 (without 1.1 and 1.2) install files a, b, and c?

Thanks.

DebbieL
01-27-2004, 02:25 PM
You asked:

So, once I already release version 1.0, and I have patch 1.1, 1.2, and 1.3, any new client needs to install version 1.0, then 1.3, right? I can't just give them 1 installation that contains the whole thing, right?"
No, you don't have to do this. If you want to distribute the full application, including all patches:
[list=1]
Open your latest QuickPatch project--in this case, 1.3--in Express.
Click the Open Release Folder button. The release folder window for your patch opens.
Go up 1 level. You'll see a number of folders. One of the folders is called UpdatedImage.
Open the UpdatedImage folder. Here you'll find an updated .msi file. You should be able to distribute this to new clients who have never installed your application.
[/list=1]

You also asked:

If version 1.1 and 1.2 have file a and b respectively, and version 1.3 has file c, will installating version 1.0, then 1.3 (without 1.1 and 1.2) install files a, b, and c?
Yes, a, b, and c will all be installed.

If you don't want files a and b installed when 1.3 patch is installed, you could do that:
[list=1]
In your 1.3 project, open the Files view.
Right-click Files To Patch and select Patch Existing File. The Select File dialog box opens.
Select the file you want to remove and click OK.
Select the file you just added.
In the right window, select the Check this box to have the patch delete this file from the setup check box.

Hope that helps.

Debbie
InstallShield Software Corporation

fniles
01-27-2004, 02:49 PM
Great!
For question 1, you said "Open the UpdatedImage folder. Here you'll find an updated .msi file. You should be able to distribute this to new clients who have never installed your application.".

Do you mean that I can just send the new client the .msi file from the "UpdatedImage" subdirectory of my quick patch built directory?
For example: the quick patch Build directory is: c:\install\quickpatch1.
I can send the new client .msi file (and no other files) from c:\install\quickpatch1\UpdatedImage ? When the client double click on the .msi file, it will install version 1.0 and all the updates until version 1.3 ?

Thanks.

fniles
01-27-2004, 03:29 PM
For question 1, you said "Open the UpdatedImage folder. Here you'll find an updated .msi file. You should be able to distribute this to new clients who have never installed your application.".

I just tried it,
For example: the quick patch Build directory is: c:\install\quickpatch1.
On a machine that never install the software, I double click on the .msi file from c:\install\quickpatch1\UpdatedImage, and after a while, it gave me error messages like the following :

"error 1308. Source file not found: c:\install\quickpatch1\UpdatedImage\program files\oursoftware\reginfo.exe. Verify that the file exists and that you can access it."

This error comes up for every files that are in the built
directory of version 1.0.
For ex: the error comes up for every files in the directory
c:\install\express\cd-room\diskimages\disk1\program files
\oursoftware.

It also comes up for every files in the directory
c:\install\express\cd-room\diskimages\disk1\system32.

What did I do wrong? Thanks a lot.

DebbieL
01-27-2004, 04:16 PM
Sorry about that! I just tried it also, and I had the same sort of problem. You were correct when you wrote the following:

So, once I already release version 1.0, and I have patch 1.1, 1.2, and 1.3, any new client needs to install version 1.0, then 1.3... I can't just give them 1 installation that contains the whole thing

If you want to distribute the entire application, you would need to create a new installation project. You might not want to do this, though, because if you need a 1.4 patch, to continue with the above example, then you'd need to create 1.4 patch that would patch the 1.3 installation, and a separate patch that would patch the base image.

Debbie
InstallShield Software Corporation

fniles
01-27-2004, 05:55 PM
Thanks a lot. So, for new clients I need to give them version 1.0 and 1.3, and until I want to change to version 2.0, I should not create a new installation project. Do I understand it correctly?
Thanks.

DebbieL
01-28-2004, 08:08 AM
Yes. That's correct.

fniles
01-28-2004, 12:27 PM
Thank you very much.