Commit 85664884 authored by Marc-André Lureau's avatar Marc-André Lureau

Set ALLUSERS=1 in perMachine install scope

Follow WiX behaviour and set ALLUSERS=1 automatically in perMachine
install scope.

https://bugzilla.redhat.com/show_bug.cgi?id=1146586
parent d96dd732
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<?define VERSION="0.0.0.0"?>
<Product
Id="*"
Name="Sample App"
Language="1033"
Version="$(var.VERSION)"
Manufacturer="Example"
UpgradeCode="44a869b4-5dd4-44b0-938b-399f41611658"
>
<Package
Description="Sample App"
Manufacturer="Example"
InstallerVersion="200"
Compressed="yes"
InstallScope="perMachine"
/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Icon Id="Icon.exe" SourceFile="FoobarAppl10.exe" />
<Property Id="ARPPRODUCTICON" Value="Icon.exe" />
<Property Id="ARPHELPLINK" Value="http://www.example.com/" />
<Feature Id="ProductFeature" Title="SampleApp" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder">
<Directory Id="INSTALLFOLDER" Name="SampleApp" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent" Guid="262eca3a-9ab0-4706-ab39-55c89819506a">
<RegistryKey Root="HKCU" Key="Software\Example\SampleApp">
<RegistryValue Name="Version" Value="[ProductVersion]" Type="string" KeyPath="yes" />
</RegistryKey>
<CreateFolder />
<RemoveFolder Id="RemoveAppRootDirectory" On="uninstall" />
<File Id="SampleApp.exe" Source="FoobarAppl10.exe"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
......@@ -4,6 +4,9 @@ AT_BANNER([wixl])
m4_define([AT_CHECK_WIXL], [
AT_CHECK([_wixl ]$@)])
m4_define([AT_CHECK_MSIINFO], [
AT_CHECK([_msiinfo ]$@)])
# AT_WIXLDATA - copy data file from source tree
m4_define([AT_WIXLDATA], [AT_MSIDATA([wixl/$1], [m4_default([$2], [$1])])])
......@@ -36,6 +39,13 @@ AT_CHECK_WIXL([-o out.msi SampleUser.wxs], [0], [ignore], [ignore])
AT_CHECK([test -f out.msi], [0])
AT_CLEANUP
AT_SETUP([SampleMachine])
AT_WIXLDATA([SampleMachine.wxs])
AT_WIXLDATA([FoobarAppl10.exe])
AT_CHECK_WIXL([-o out.msi SampleMachine.wxs], [0], [ignore], [ignore])
AT_CHECK_MSIINFO([export out.msi Property | grep -q 'ALLUSERS 1'], [0])
AT_CLEANUP
AT_SETUP([Stable component GUIDs])
AT_WIXLDATA([ComponentGUID.wxs])
AT_WIXLDATA([FoobarAppl10.exe])
......
......@@ -327,12 +327,13 @@ namespace Wixl {
int source = SourceFlags.COMPRESSED;
if (package.InstallScope != null) {
if (package.InstallScope == "perUser")
if (package.InstallScope == "perUser") {
source |= SourceFlags.NO_PRIVILEGES;
else if (package.InstallScope == "perMachine")
source |= 0;
else
} else if (package.InstallScope == "perMachine") {
db.table_property.add ("ALLUSERS", "1");
} else {
error ("invalid InstallScope value: %s", package.InstallScope);
}
}
db.info.set_property (Libmsi.Property.SOURCE, source);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment