Hi,
I'm using the following code snippet inside a function to set the property
inside COM DLL:

hr = WcaSetIntProperty(L"PROPNAME", 1);

ExitOnFailure(hr, "Failed to set PROPNAME property value");

I'm calling this function from the WIX code using Custom Action DLL Entry.
Snippet:
<Property Id ="PROPNAME" Value="0"/>


<Directory Id="TARGETDIR" Name="SourceDir">

<Directory Id="ProgramFilesFolder">

<Directory Id="INSTALLLOCATION" Name="MINE">

<Component Id="MY_COMPONENT" Guid="{43202408-8161-4116-ab7a-d51200c27b77}">

<File Id="New1" Source ="COMPONENTS.txt" KeyPath="yes"/>

</Component>

<Component Id="MY_COMPONENT_2" Guid="{4F0EC3D4-AB5D-4C90-A12B-BF9383BFDD9C}"
>

<File Id="New2" Source="COMPONENTS2.txt"/>

</Component>

</Directory>

</Directory>

</Directory>

<!--START : For Importing Custom C++ DLL -->

<Binary Id="BID_SampDLL" SourceFile="
$(var.SolutionDir)\SampleCustomAction\bin\$(var.Configuration)\SampleCustomAction.dll
" />

<CustomAction Id="CA_SampDLL1" BinaryKey="BID_SampDLL" DllEntry="SetProp"
Execute="immediate" Return="check" HideTarget="no" />

<!--END : For Importing Custom C++ DLL -->

 <InstallExecuteSequence>

<Custom Action="CA_SampDLL1" Before="ProcessComponents">NOT Installed</
Custom>
</InstallExecuteSequence>


<Feature Id="ProductFeature" Title="SetupProject" Level="0" >

<Feature Id="CORE_COMPONENTS" Title="Core Components" Level="1">

<Condition Level="0"><![CDATA[PROPNAME <> 1]]></Condition>

<ComponentRef Id="MY_COMPONENT"/>

</Feature>

<Feature Id="CORE_COMPONENTS2" Title="Core Components2" Level="1">

<Condition Level="0"><![CDATA[PROPNAME2 <> 1]]></Condition>

<ComponentRef Id="MY_COMPONENT2"/>

</Feature>

</Feature>
Here in my code I'm trying to set the property so that when i run the
command:
"msiexec /i sampleInstaller.msi /qb"
Only one of my component must be installed.

Here i'm trying to attain functionality through COM DLL which would be
similar to installation using the following command:
"msiexec /i sampleInstaller.msi PROPNAME=1 /qb"
Thanks in Advance,

With Warm Regards,
Vijay Chander


______________________________________________________________________
Date: Mon, 7 Jun 2010 07:50:05 -0700
From: Rob Mensching <r...@robmensching.com>
Subject: Re: [WiX-users] Can we control registration of Components
       from a  COM DLL
To: "General discussion for Windows Installer XML toolset."
       <wix-users@lists.sourceforge.net>
Message-ID:
       <aanlktimn1ivovzt1bi2rkpvacy-qhkconwdxfycf2...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Follow the Property value in a verbose log file. That'll tell you what is
going on.

On Mon, Jun 7, 2010 at 5:19 AM, vijay chander <
vijaychander2...@gmail.com>wrote <vijaychander2...@gmail.com%3ewrote>:

> Hi All,
>
>
> I'm trying to attain unattended installation using WIX, where I need to
> read
> some parameters from .ini file and set the properties to select only some
> features on installation.
> I have tried setting Properties using both MsiSetProperty and
> WcaSetProperty
> as mentioned below:
>
> MsiSetProperty(hInstall, L"SERVER", L"1");
>
> hr = WcaSetProperty(L"SERVER", L"1");
>
> and I'm running commandline "msiexec /i sample.msi /qb" without giving any
> parameter expecting it would be picked up from my DLL which uses either of
> MsiSetProperty or WcaSetProperty.
>
> I was able to fetch the default property value and set it to the value
> which
> i was sending from the .ini file but the problem is that particular
> component was not installing as expected.
>
> Thanks in Advance,
>
> Regards,
>
> Vijay Chander
>
>
------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to