cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RayKode
Level 6

Preventing a patch from being applied

Good morning,
It has been some time since I last posted a question to this forum.
I hope everyone is well.

I want to know, how I can prevent a patch (or at least display an error message) when a user attempts to apply it (the patch) to a version of my application for which the patch was NOT authored ?

Please read on for the details.

IS 2011 professional.

I have four versions of my application.
1.1.1
1.1.2
1.1.3
1.1.4

I build a patch (via the patch design view) with Latest1 containing 1.1.3 and Prev1 containing 1.1.2.

The patch works perfectly when applied to version 1.1.2 of my application.

What I have found however, is ........

One:
I receive an error message
[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 be for a different version of the program.]
if I try and apply this same patch to 1.1.4 of my application. (A GOOD thing.)

Two:
The patch actually runs if I apply it to version 1.1.1 of my application.
(A BAD thing.)

Three:
The patch actually runs if I apply it to version 1.1.3 of my application. (A BAD thing.)

Here are my questions:
Question one:
Is the above behavior to be expected ?

For some reason, I expected the same error message (please see above), that I get when applying the patch to version 1.1.4 of my application, when I try and apply the patch to versions 1.1.1 and 1.1.3 of my application.

Question two:
Is there a way for me to, in some fashion, stop the path from being applied to versions of my application older than what is in the Prev1 folder ?
(In this case it is version 1.1.2)
Ideally, I would like the user to receive the same error message as documented above.

Question three:
Is there a way for me to, in some fashion, stop the patch from being applied to version equal to the version that is in the Latest1 folder ?
(In this case version 1.1.3)
Ideally, I would like the user to receive the same error message as documented above.


Thanks in advance for any and all responses.

Ray in Wisconsin
Labels (1)
0 Kudos
(2) Replies
Cary_R
Level 11

Hi Ray,

The key to your issue lies in the notion that *.msp files are wrappers around database transforms (*.mst). These have validation bits that determine what packages they can be applied to based on certain criteria.

When building a patch you get one set of transforms for each 'Previous' setup you specify, and there's settings for these validation options under the 'Advanced' tab of the Previous setup item.

Give this a try, and see if it gets you the behavior that you're looking for.

Regards,
0 Kudos
RayKode
Level 6

Thanks to Cary, George and Alpesh(Installshield),I have come to understand the solution to my issue as ....

Set the Version Relationship value to either "Previous Setup Version >= Latest Setup Version" or "Previous Setup Version = Latest Setup Version", for each "PrevXX" in my patch project.
Either value produces the exact same result for me.

Using my previous post as an example then:

Employing the above Version Relationship setting(s) ....
I now receive the
[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 be for a different version of the program.]
message ...

If I try and apply the patch ...
Over an already installed version 1.1.1 of my application.

Over an already installed version of 1.1.3 of my application.

Over an already installed version 1.1.4 of my application.

So life is now grand.
0 Kudos