[wix-devs] Determining msiexec command line repair options from within a custom action

Ron Martin cpuwzd at comcast.net
Mon Aug 22 13:58:56 PDT 2022


Bob,

Here's the situation: An initial installation changes the comment on a 
user account. I place the previous comment in a rollback script that is 
written to a file. This will be used on an install rollback or an 
uninstall to restore the original comment to the account. If I run a 
repair operation on the installation, I don't want to write the current 
comment to the rollback script: I want to leave the rollback script as 
it was written during the  original installation. How can I avoid 
overwriting the file. Can I rely on the existence of the file based on 
its path to tell me that the initial state has already been preserved. I 
assume that I can get to this file path and that it is unique to this 
installation.

What repair flags should be passed to msiexec when we are running repair 
tests? I know that "-f" is a disaster.

Thanks.

Ron

On 8/21/2022 10:46 PM, Bob Arnson wrote:
> https://docs.microsoft.com/en-us/windows/win32/msi/command-line-options  is better doc: There is a default for -f and it documents the combinations.
>
> Custom actions don't differentiate among repair options: What matters are the states of the component, which is summarized by WcaGetComponentToDo.
>
>> -----Original Message-----
>> From: wix-devs<wix-devs-bounces at lists.wixtoolset.org>  On Behalf Of Ron
>> Martin via wix-devs
>> Sent: Sunday, 21 August, 2022 22:23
>> To: wix-devs<wix-devs at lists.wixtoolset.org>
>> Cc: Ron Martin<cpuwzd at comcast.net>
>> Subject: [wix-devs] Determining msiexec command line repair options from
>> within a custom action
>>
>> I am trying to determine the active msiexec command-line repair options
>> from within a custom action such as CreateUser.
>>
>> I have determined that the internal repair command adds "-f " to the
>> command line. This seems to assume that there is only one repair option.
>> In reality, there are quite a few, and "-f" is not among them. The repair
>> options all contain a second letter determining what is to be repaired. These
>> options can be merged: For example, if "-fx" and "-fy"
>> are both valid and compatible, "-fxy" will activate both actions. The syntax in
>> the documentation does not include this merging.
>>
>> On the other hand, "-f", itself, is invalid: it silently aborts the parsing of the
>> command line. Unfortunately, this means that file names, etc., that may
>> follow the repair option on the command line are also ignored. One of our
>> failing tests "CanRepair..." fails because of this.
>>
>> I cannot find any place in our code that differentiates these cases, nor have I
>> figured out how such a differentiation can be made. What does msiexec do
>> with the parsed repair options and how can they be accessed from our code?
>> I have one place in my new code where I would like to use this information,
>> but I don't know how to access it.
>>
>> I think that a general discussion of the different repair options is in order
>> with regard to how they should affect Wix operations overall.
>>
>> Is anyone game?
>>
>> Ron
>> ________________________________________________________________
>> ____
>> WiX Toolset Developer Mailing List provided by FireGiant
>> http://www.firegiant.com/


More information about the wix-devs mailing list