Hi,

I have a small problem during major upgrade with Registry/Permission
element. I have created a very simple example replicating the problem,
the sources are below. 

Steps to recreate:

1. In msi version 1 I create registry key and add some permission to it
for "NetworkService" user. 
2. In msi version 2 I update the same registry key and I also have the
same permission tag there. Also in this second msi I have a condition
which always triggers the rollback (to simulate the problem I have in my
real life msi)
3. Install the msi version 1
4. Install the msi version 2 over it -> major upgrade -> forced rollback

5. After the rollback, the system is not restored to the exact state as
it was before installation of the msi version 2. The permissions are
deleted! So they are reverted to the state before installation of the
msi version 1.

----------------------------------------------------------------------
The first msi source:
----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
    <Product Id="????????-????-????-????-????????????" Name="Permission
Test" Language="1033" Version="2.0.0"
             UpgradeCode="4086DDFE-9912-425F-835D-0ACD310BD9DE"
Manufacturer="TestCompany" >
        <Package Id="????????-????-????-????-????????????"
ShortNames="no" InstallerVersion="200"
                 Compressed="yes" Manufacturer="TestCompany" />

        <Media Id="1" Cabinet="PermissionTest.cab" EmbedCab="yes" />

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Component Id="RegistryComp" DiskId="1"
Guid="EADA08EB-14F1-44bf-962F-A7FEDB7B8D94">
                <Registry Action="write" Type="string"
Key="SOFTWARE\PermissionTest" Name="Test" Value="2.0.0" Root="HKLM" >
                    <Permission GenericAll='yes' EnumerateSubkeys='yes'
CreateSubkeys='yes' Extended='yes' User='NetworkService' />
                </Registry>
            </Component>
        </Directory>

        <Upgrade Id="4086DDFE-9912-425F-835D-0ACD310BD9DE">
            <UpgradeVersion OnlyDetect="no" Property="UPGRADE"
IncludeMinimum="yes" IncludeMaximum="no" MigrateFeatures="yes"
IgnoreRemoveFailure="no"
                            Minimum="1.0.0" Maximum="2.0.0" />
        </Upgrade>

        <!-- Sequence of install actions -->
        <InstallExecuteSequence>
            <RemoveExistingProducts After="InstallInitialize"
>UPGRADE</RemoveExistingProducts>
        </InstallExecuteSequence>

        <Feature Id="Complete" Title="PermissionTest" Level="1"
TypicalDefault="install" Absent="disallow" 
                 AllowAdvertise="no">
            <ComponentRef Id="RegistryComp"/>
        </Feature>

        <Property Id='ALLUSERS' Value='1' />
    </Product>
</Wix>

----------------------------------------------------------------------
The second msi source:
----------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi";>
    <Product Id="????????-????-????-????-????????????" Name="Permission
Test" Language="1033" Version="2.0.1"
             UpgradeCode="4086DDFE-9912-425F-835D-0ACD310BD9DE"
Manufacturer="TestCompany" >
        <Package Id="????????-????-????-????-????????????"
ShortNames="no" InstallerVersion="200"
                 Compressed="yes" Manufacturer="TestCompany" />

        <Media Id="1" Cabinet="PermissionTest.cab" EmbedCab="yes" />

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Component Id="RegistryComp" DiskId="1"
Guid="EADA08EB-14F1-44bf-962F-A7FEDB7B8D94">
                <Registry Action="write" Type="string"
Key="SOFTWARE\PermissionTest" Name="Test" Value="2.0.1" Root="HKLM" >
                    <Permission GenericAll='yes' EnumerateSubkeys='yes'
CreateSubkeys='yes' Extended='yes' User='NetworkService' />
                </Registry>
            </Component>
        </Directory>

        <Upgrade Id="4086DDFE-9912-425F-835D-0ACD310BD9DE">
            <UpgradeVersion OnlyDetect="no" Property="UPGRADE"
IncludeMinimum="yes" IncludeMaximum="no" MigrateFeatures="yes"
IgnoreRemoveFailure="no"
                            Minimum="1.0.0" Maximum="2.0.1" />
        </Upgrade>

        <CustomAction Id='ForceRollback' Error='Forced Rollback' />

        <!-- Sequence of install actions -->
        <InstallExecuteSequence>
            <RemoveExistingProducts After="InstallInitialize"
>UPGRADE</RemoveExistingProducts>
            <Custom Action="ForceRollback" Sequence="4001">1</Custom>
        </InstallExecuteSequence>

        <Feature Id="Complete" Title="PermissionTest" Level="1"
TypicalDefault="install" Absent="disallow" 
                 AllowAdvertise="no">
            <ComponentRef Id="RegistryComp"/>           
        </Feature>

        <Property Id='ALLUSERS' Value='1' />
    </Product>
</Wix>

----------------------------------------------------------------------

Any ideas how to avoid this? Is it a bug?

I have also tried it in Wix 3.0.3221 with the same result (using the
UtilExtension)

Thanks

Jan Brabec
Radiant Systems


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to