Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

using [ProductVersion] in an install condition


17 replies to this topic

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 26 January 2012 - 17:22

So In an attempt to prevent downgrades I attempted to use the ISPreventDowngrade mechanism with the built in error text. It only displays when the version installed is a major upgrade from the version i am trying to downgrade to. If it is a minor upgrade from the version i am attempting to downgrade to; the installer starts to run and no dialogs or errors display it just closes the application. As a work around mechanism I pondered the idea of reading the version out of the registry entry and then comparing it to [ProductVersion] in an install condition.

Stefan implied there was another way to do this with minor up/downgrade in this post: http://forum.install...showtopic=17917

The issue with my thought is that the conditional statement does not appear to like having [ProductVersion] in the statement (it throws an error). If I try to change it to just ProductVersion the conditional reads as regVers < ProductVersion but once you exit the wizard it shows the evaluation of it is "regVers" which would always be true.

Surely there is a better way to go about doing this.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 January 2012 - 17:43

QUOTE
the conditional statement does not appear to like having [ProductVersion] in the statement (it throws an error).

That's correct, in a conditional statement you don't put [] around property names.

QUOTE
If I try to change it to just ProductVersion the conditional reads as regVers < ProductVersion but once you exit the wizard it shows the evaluation of it is "regVers" which would always be true.

Not sure what you mean: which wizard? At design time (in the InstallShield IDE) or at runtime/install time?

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 26 January 2012 - 17:50

What I mean is in the IDE if I click on Product Properties and double click on 'Install Condition' (I have 4) A dialog (which i am referring to as the wizard) pops up and shows my 4 conditions. The one in question displays my REGVER which is a property set during a system search in a statement that reads as "REGVER<ProductVersion" without the "" and when I click ok the condition says "REGVER" without the "" with the message set to [IS_PREVENT_DOWNGRADE_EXIT]




Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 January 2012 - 17:53

Seems to work for me, maybe a bug in your version?
You could always go to the Direct Editor, open the LaunchConditions table and edit it there.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 26 January 2012 - 18:04

Ok set it in the direct editor and it seems happy there. I'll give that a try and see if it works. Thanks for the advice.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 26 January 2012 - 19:25

So even if I remove the action in the sequence for ISPreventDowngrade I still get the behavior that i described earlier. The downgrade is prevented but nothing happens. No error message no nothing. AppSearch and LaunchConditions are the first 2 actions in the execute sequence and are after only SetupCompleteError, SetupCompleteSuccess and SetupInterrupted in the User Interface sequence.

they are even before file extraction but seems to take place after regardless. So my conditional never seems to get evaluated b/c find related products seems to happen before it? Findrelatedproducts is way later in the sequence though

attaching screenshots of the sequence for reference


user posted image user posted image

Edited by overlordchin, 26 January 2012 - 19:27.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 January 2012 - 10:38

I don't think your setup exits because of the ISPreventDowngrade action. Generate a log file, this will tell you the actual values of the properties, whether AppSearch finds anything, and why (or at least: when) your setup dies.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 27 January 2012 - 13:57

QUOTE (Stefan Krueger @ 2012-01-27 10:38)
I don't think your setup exits because of the ISPreventDowngrade action. Generate a log file, this will tell you the actual values of the properties, whether AppSearch finds anything, and why (or at least: when) your setup dies.

How do I enable logging in a basic msi installer? I see "MsiLogging" in the direct editor and it is set to "voicewarmupx"


Am I correct in assuming the log will be in temp with the name MSI{GUID}.log?

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 27 January 2012 - 14:50

ok I turned it on in the registry by following this article:

http://support.microsoft.com/kb/223300


and this is the log file:

CODE

=== Verbose logging started: 1/27/2012  8:42:15  Build type: SHIP UNICODE 3.01.4001.5512  Calling process: \\build\Shared\Installers\Internal\setup.exe ===
MSI (c) (8C:60) [08:42:15:139]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'C:\WINDOWS\Installer\aa792c.msi' against software restriction policy
MSI (c) (8C:60) [08:42:15:139]: SOFTWARE RESTRICTION POLICY: C:\WINDOWS\Installer\aa792c.msi has a digital signature
MSI (c) (8C:60) [08:42:15:311]: SOFTWARE RESTRICTION POLICY: C:\WINDOWS\Installer\aa792c.msi is permitted to run at the 'unrestricted' authorization level.
MSI (c) (8C:60) [08:42:15:389]: Cloaking enabled.
MSI (c) (8C:60) [08:42:15:389]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (8C:60) [08:42:15:420]: End dialog not enabled
MSI (c) (8C:60) [08:42:15:420]: Original package ==> C:\WINDOWS\Installer\aa792c.msi
MSI (c) (8C:60) [08:42:15:420]: Package we're running from ==> C:\WINDOWS\Installer\aa792c.msi
MSI (c) (8C:60) [08:42:15:420]: APPCOMPAT: looking for appcompat database entry with ProductCode '{C6642AF6-6E27-43C4-9C99-E53257D47EA5}'.
MSI (c) (8C:60) [08:42:15:420]: APPCOMPAT: no matching ProductCode found in database.
MSI (c) (8C:60) [08:42:15:420]: MSCOREE not loaded loading copy from system32
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'DisablePatch' is 0
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'AllowLockdownPatch' is 0
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'DisableLUAPatching' is 0
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'DisableFlyWeightPatching' is 0
MSI (c) (8C:60) [08:42:15:436]: Enabling baseline caching for this transaction since all active patches are MSI 3.0 style MSPs or at least one MSI 3.0 minor update patch is active
MSI (c) (8C:60) [08:42:15:436]: APPCOMPAT: looking for appcompat database entry with ProductCode '{C6642AF6-6E27-43C4-9C99-E53257D47EA5}'.
MSI (c) (8C:60) [08:42:15:436]: APPCOMPAT: no matching ProductCode found in database.
MSI (c) (8C:60) [08:42:15:436]: Transforms are not secure.
MSI (c) (8C:60) [08:42:15:436]: No Command Line.
MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding PackageCode property. Its value is '{B348B923-CC47-4247-8FF5-FE1377140DAB}'.
MSI (c) (8C:60) [08:42:15:436]: Product Code passed to Engine.Initialize:           '(none)'
MSI (c) (8C:60) [08:42:15:436]: Product Code from property table before transforms: '{C6642AF6-6E27-43C4-9C99-E53257D47EA5}'
MSI (c) (8C:60) [08:42:15:436]: Product Code from property table after transforms:  '{C6642AF6-6E27-43C4-9C99-E53257D47EA5}'
MSI (c) (8C:60) [08:42:15:436]: Product registered: entering maintenance mode
MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding ProductState property. Its value is '5'.
MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding ProductToBeRegistered property. Its value is '1'.
MSI (c) (8C:60) [08:42:15:436]: Package name retrieved from configuration data: 'My.msi'
MSI (c) (8C:60) [08:42:15:436]: Determined that existing product (either this product or the product being upgraded with a patch) is installed per-machine.
MSI (c) (8C:60) [08:42:15:436]: Note: 1: 2729
MSI (c) (8C:60) [08:42:15:436]: Note: 1: 2729
MSI (c) (8C:60) [08:42:15:436]: Note: 1: 2262 2: AdminProperties 3: -2147287038
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'DisableMsi' is 0
MSI (c) (8C:60) [08:42:15:436]: Machine policy value 'AlwaysInstallElevated' is 0
MSI (c) (8C:60) [08:42:15:436]: User policy value 'AlwaysInstallElevated' is 0
MSI (c) (8C:60) [08:42:15:436]: Product {C6642AF6-6E27-43C4-9C99-E53257D47EA5} is admin assigned: LocalSystem owns the publish key.
MSI (c) (8C:60) [08:42:15:436]: Product {C6642AF6-6E27-43C4-9C99-E53257D47EA5} is managed.
MSI (c) (8C:60) [08:42:15:436]: Running product '{C6642AF6-6E27-43C4-9C99-E53257D47EA5}' with elevated privileges: Product is assigned.
MSI (c) (8C:60) [08:42:15:436]: TRANSFORMS property is now:
MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding PRODUCTLANGUAGE property. Its value is '1033'.
MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding VersionDatabase property. Its value is '200'.
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Application Data
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Favorites
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\NetHood
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\My Documents
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\PrintHood
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Recent
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\SendTo
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Templates
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Application Data
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Local Settings\Application Data
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\My Documents\My Pictures
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Start Menu\Programs\Startup
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Start Menu\Programs
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Start Menu
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Desktop
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Start Menu\Programs\Administrative Tools
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Start Menu\Programs\Startup
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Start Menu\Programs
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Start Menu
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\QA\Desktop
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Templates
MSI (c) (8C:60) [08:42:15:436]: SHELL32::SHGetFolderPath returned: C:\WINDOWS\Fonts
MSI (c) (8C:60) [08:42:15:452]: Note: 1: 2898 2: MS Sans Serif 3: MS Sans Serif 4: 0 5: 16
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding Privileged property. Its value is '1'.
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding USERNAME property. Its value is 'QA'.
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding COMPANYNAME property. Its value is 'MyCompany'.
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding Installed property. Its value is '2012/01/26 07:21:58'.
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding DATABASE property. Its value is 'C:\WINDOWS\Installer\aa792c.msi'.
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding OriginalDatabase property. Its value is 'C:\WINDOWS\Installer\aa792c.msi'.
=== Logging started: 1/27/2012  8:42:15 ===
MSI (c) (8C:60) [08:42:15:452]: Note: 1: 2205 2:  3: PatchPackage
MSI (c) (8C:60) [08:42:15:452]: Machine policy value 'DisableRollback' is 0
MSI (c) (8C:60) [08:42:15:452]: User policy value 'DisableRollback' is 0
MSI (c) (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding UILevel property. Its value is '2'.
MSI (c) (8C:60) [08:42:15:452]: Creating MSIHANDLE (1) of type 790537 for thread 3936
MSI (c) (8C:60) [08:42:15:452]: MsiOpenPackageEx is returning 0
MSI (c) (8C:60) [08:42:15:452]: MsiOpenPackage is returning 0
MSI (c) (8C:60) [08:42:15:452]: Closing MSIHANDLE (1) of type 790537 for thread 3936
=== Verbose logging stopped: 1/27/2012  8:42:15 ===




overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 27 January 2012 - 15:49

If I change the ProductCode app search actually happens and my conditional fails and it does not prevent the downgrade. If i dont change the product code as evident by the log it dies before it even starts the appsearch.

I did a diff on the two log files and the new file has these differences:

CODE

MSI (c) (A4:3C) [09:44:25:561]: Resetting cached policy values
MSI (c) (A4:3C) [09:44:25:561]: Machine policy value 'Debug' is 0
MSI (c) (A4:3C) [09:44:25:561]: ******* RunEngine:
          ******* Product: C:\Documents and Settings\QA\Local Settings\Application Data\Downloaded Installations\{263A3282-EF26-47AB-8CDB-6BA217663CE1}\My.msi
          ******* Action:
          ******* CommandLine: **********
MSI (c) (A4:3C) [09:44:25:561]: Machine policy value 'DisableUserInstalls' is 0



CODE
MSI (c) (A4:3C) [09:44:28:436]: SOFTWARE RESTRICTION POLICY: Verifying package --> 'C:\Documents and Settings\QA\Local Settings\Application Data\Downloaded Installations\{263A3282-EF26-47AB-8CDB-6BA217663CE1}\My.msi' against software restriction policy
MSI (c) (A4:3C) [09:44:28:436]: SOFTWARE RESTRICTION POLICY: C:\Documents and Settings\QA\Local Settings\Application Data\Downloaded Installations\{263A3282-EF26-47AB-8CDB-6BA217663CE1}\My.msi has a digital signature
MSI (c) (A4:3C) [09:44:29:452]: SOFTWARE RESTRICTION POLICY: C:\Documents and Settings\QA\Local Settings\Application Data\Downloaded Installations\{263A3282-EF26-47AB-8CDB-6BA217663CE1}\My.msi is permitted to run at the 'unrestricted' authorization level.



CODE

MSI (c) (A4:3C) [09:44:29:499]: Product installation will be elevated because user is admin and product is being installed per-machine.
MSI (c) (A4:3C) [09:44:29:499]: Running product '{9D196378-8B0C-4F55-BD75-14CE6A17DBA4}' with elevated privileges: Product is assigned.
MSI (c) (A4:3C) [09:44:29:499]: PROPERTY CHANGE: Adding SETUPEXEDIR property. Its value is '\\build\Shared\Installers\Internal'.
MSI (c) (A4:3C) [09:44:29:499]: PROPERTY CHANGE: Adding CURRENTDIRECTORY property. Its value is '\\build\Shared\Installers\Internal'.
MSI (c) (A4:3C) [09:44:29:499]: PROPERTY CHANGE: Adding CLIENTUILEVEL property. Its value is '0'.
MSI (c) (A4:3C) [09:44:29:499]: PROPERTY CHANGE: Adding CLIENTPROCESSID property. Its value is '4004'.



Just noticed this subtle difference:
CODE

MSI (c) (A4:3C) [09:44:29:499]: PROPERTY CHANGE: Adding ProductState property. Its value is '-1'.


vs

CODE

MSI (c) (8C:60) [08:42:15:436]: PROPERTY CHANGE: Adding ProductState property. Its value is '5'.


When the product code is change it sets the productstate property value to -1 as in the product is not currently installed on the machine. When it is not changed it sets it to 5.. so the products is installed for the current user. Which makes sense when I think about it. It says "MSI © (8C:60) [08:42:15:436]: Product registered: entering maintenance mode" right before that message in the log where I did not change the product code. Not sure if that is significant or its just 'hey i detected a previous version going into maintenance mode to attempt an upgrade'

Edited by overlordchin, 27 January 2012 - 17:59.


overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 30 January 2012 - 15:10

I also tried this to generate a log file and see if there would be any difference:

mysetup.exe /Verbose"c:\testing.log"

no additional log file was created only the one in temp that is MSIxxxxx.LOG which is the one I posted on Friday.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 30 January 2012 - 17:17

If you change the ProductCode it's essentially a new product, which is not installed, and the installer enters first time install mode. If you don't change the ProductCode (but did change the PackageCode, which InstallShield automatically does, and launched using the /v parameter or using InstallSHield's setup.exe) then the product is already installed and the installer enters maintenance mode, using the new msi file.
In the first case it's a major upgrade and the Upgrade table is used. The second case id a minor update and the Upgrade table is not used.

In your log I noticed that you are calling MsiOpenPackageEx. What are you doing there?

BTW the link to how to log a setup is in my signatur smile.gif

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 30 January 2012 - 17:45

I have no idea what causes the MSIOpenPackage or Ex messages. I tried changing the package code and not the product code and got the same behavior that I had been seeing previously. When I looked at the wording on the package code it seems that it changes it automatically if you do a new release. If you are rebuilding the same release (which is the way we have been doing it for ages) it is implied that the package code does not change.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 02 February 2012 - 20:10

Any other ideas out there? I still have no idea what causes that message but in doing some research I have found other products with an install log that looks very similar. The fixes they applied do not work for me or change the output in the log file.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 06 February 2012 - 20:35

So in looking at the tail of the logfile again it looks like its going into silent mode and then immediately closing the msi handle. So it hits silent opens the msi handle sees there is nothing to do and then closes it. Any thoughts as to why?

MSI © (8C:60) [08:42:15:452]: PROPERTY CHANGE: Adding UILevel property. Its value is '2'.
MSI © (8C:60) [08:42:15:452]: Creating MSIHANDLE (1) of type 790537 for thread 3936
MSI © (8C:60) [08:42:15:452]: MsiOpenPackageEx is returning 0
MSI © (8C:60) [08:42:15:452]: MsiOpenPackage is returning 0
MSI © (8C:60) [08:42:15:452]: Closing MSIHANDLE (1) of type 790537 for thread 3936
=== Verbose logging stopped: 1/27/2012 8:42:15 ===

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 07 February 2012 - 15:43

Sorry, I have no idea.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 08 February 2012 - 21:29

So I have another installer that actually works correctly and displays the dialog. First it pops up and says this will preform an upgrade do you wish to continue? then if you click yes it throws the error message and prevents a potential downgrade. I generated a log file for it and it looks EXACTLY like the first one i posted with the exceptions of guids timestamps and names of the msi files. It was identical in every other way which explains why the original log file doesnt help diagnose the issue since the one that works correctly has the exact same log output. Just gonna have to start comparing the two for differences. If I figure out what it is I will be sure to post it here.

overlordchin

overlordchin
  • Full Members
  • 100 posts

Posted 08 February 2012 - 22:04

I found it. It actually was using ISPreventDowngrade to prevent the downgrade it just never popped the error dialog or any dialog for that matter. In the upgrade section under the behavior the minor upgrade settings behavior was set to "dont prompt the user just install the upgrade" I flipped it to prompt and tried again. It threw the error right away. Thanks for looking at the logs and all the help. I hope this post helps someone else.