Hey Kevin,

Have a look at MsiSetProperty
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/msisetproperty.asp)
Also, this msi custom action tutorial can probably help more than I can.
http://codeproject.com/tips/msicustomaction.asp

Jim

> That is not really what I wanted to hear. Now I have to dredge up what
> I used to know about accessing a SQL database via ADO or ODBC. Oh,
> well.
>
> I looked on the Nant site and could not see any documentation on a
> programming API where I could set a property from a custom action.
> Where should I look?
>
> Finally if the source of the custom action is the Win32 DLL that I have
> created and the target is the entry point (DLLMain), where do I specify
> the exported function and its arguments?
>
> Thanks again.
>
> Kevin
>
> -----Original Message-----
> From: James Geurts [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 12:42 PM
> To: Burton, Kevin
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [NAntC-Dev] Installing .msi package from <msi> could not
> find DLL.
>
>
> Yep, you use that syntax for using properties.  As for reading sql
> values, you'll probably need to create a custom action to do that.  You
> can have that custom action set a [msi] property name with it's
> associated value.
>
> Jim
>
>> I am assuming if I have:
>>
>>            <search>
>>                <key type="registry" path="SOFTWARE\Visa\PPC"
>>                root="machine" >
>>                    <value name="Database Server"
>>                    setproperty="SQLServer" />
>>                </key>
>>                <key type="registry" path="SOFTWARE\Visa\PPC"
>>                root="machine" >
>>                    <value name="Database Catalog"
>>                    setproperty="SQLCatalog" />
>>                </key>
>>            </search>
>>
>> I have to use the following syntax to refer to these properties
>> (enclosed in []):
>>
>>            <customactions>
>>                <customaction action="caSetTargetDir" type="51"
>>                source="TARGETDIR"
>>
> target="[ProgramFilesFolder]\[Manufacturer]\[ProductName]"
>>                              />
>>                <customaction action="ConfigureLOC1" type="2"
>>                source="OSQL" target="-E -n -d {0} -S [SQLServer] -i
>>                ""[TARGETDIR]/PPC_LOC_DML.SQL""" /> <customaction
>>                action="ConfigureLOC2" type="2" source="OSQL"
>>                target="-E -n -d {0} -S [SQLServer] -i
>>                ""[TARGETDIR]/PPC_LOC_DML.SQL""" /> <customaction
>>                action="ConfigureDDL" type="2" source="OSQL" target="-E
>>                -n -d [SQLCatalog] -S [SQLServer] -i
>>                ""[TARGETDIR]/PPC_LOC_DML.SQL""" /> <customaction
>>                action="ConfigureDML" type="2" source="OSQL" target="-E
>>                -n -d [SQLCatalog] -S [SQLServer] -i
>>                ""[TARGETDIR]/PPC_DDL.SQL""" />
>>            </customactions>
>>
>> Now what about reading the database? I saw that there is a task in the
>> contrib, <sql> but that obviously does not execute on the target
>> machine. Is there another <search> type that would execute this for
>> me? Basically I want the following on the target machine.
>>
>>        <sql
>>            connstring="Integrated Security=SSPI;Enlist=false;Data
>>            Source=${SQLServer};Initial Catalog=${SQLCatalog}"
>>            delimiter=";"
>>            delimstyle="Normal"
>>            output="${build.dir}/sqlresults.txt">
>>            SELECT DATABASE_LOC1, DATABASE_LOC2 FROM PPMCNFG;
>>        <sql/>
>>
>> I am almost there. Thank you for your help.
>>
>> Kevin
>>
>> -----Original Message-----
>> From: James Geurts [mailto:[EMAIL PROTECTED]
>> Sent: Friday, September 17, 2004 10:48 AM
>> To: Burton, Kevin
>> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>> Subject: RE: [NAntC-Dev] Installing .msi package from <msi> could not
>> find DLL.
>>
>>
>> That looks ok.
>>
>> You can get the info from the registry and set it to an msi property.
>> You can then pass that property to the custom action definition.  Have
>> a look at the <search> sub element... something like the following:
>> <search>
>>    <key type="registry" path="Software\Microsoft\InetStp"
>>    root="machine" >
>>        <value name="PathWWWRoot" setproperty="IISWWWROOT" />
>>    </key>
>> </search>
>>
>> to find the target directory, you can use the msi property TARGETDIR.
>>
>> Just a thought, but it might be easier to just write up a c# (or
>> whatever language) .exe custom action and pass it the TARGETDIR info
>> via a
>> commandline switch.
>>
>> Jim
>>
>>> OK, I am now realizing that it is slightly more complicated and I was
>>> hoping for some more advice. I now have the targets specified as
>>> below. The problem is that on the TARGET machine I need to read the
>>> registry to find the default catalog and the server for the database.
>>> I also need to read from the database to read two values that will be
>>> the default catalog for the first two custom actions below. Finally I
>>> need to know target location. Where has the user chosen to install
>>> these files so I know where to find the SQL scripts. How can I get
>>> this information on the target? Other than the command line arguments
>>> does the below look correct? In particular can I just pick
>>> consecutive sequence numbers like I have done and that will be the
>>> order the scripts are executed in?
>>>
>>> Thank you again.
>>>
>>> Kevin
>>>
>>>            <binaries>
>>>                <binary name="OSQL" value="C:\Program Files\Microsoft
>>>                SQL Server\80\Tools\Binn\osql.exe" />
>>>            </binaries>
>>>
>>>            <customactions>
>>>                <customaction action="caSetTargetDir" type="51"
>>>                source="TARGETDIR"
>>>
>> target="[ProgramFilesFolder]\[Manufacturer]\[ProductName]"
>>>                              />
>>>                <customaction action="ConfigureLOC1" type="2"
>>>                source="OSQL" target="-E -n -d {0} -S {1} -i
>>>                ""PPC_LOC_DML.SQL""" /> <customaction
>>>                action="ConfigureLOC2" type="2" source="OSQL"
>>>                target="-E -n -d {0} -S {1} -i ""PPC_LOC_DML.SQL""" />
>>>                <customaction action="ConfigureDDL" type="2"
>>>                source="OSQL" target="-E -n -d {0} -S {1} -i
>>>                ""PPC_LOC_DML.SQL""" /> <customaction
>>>                action="ConfigureDML" type="2" source="OSQL"
>>>                target="-E -n -d {0} -S {1} -i ""PPC_DDL.SQL""" />
>>>            </customactions>
>>>
>>>            <sequences>
>>>                <sequence type="installexecute"
>>>                action="caSetTargetDir" condition="NOT TARGETDIR"
>>>                          value="120" />
>>>                <sequence type="installui" action="caSetTargetDir"
>>>                condition="NOT TARGETDIR"
>>>                          value="120" />
>>>                <sequence type="adminexecute" action="caSetTargetDir"
>>>                condition="NOT TARGETDIR"
>>>                          value="120" />
>>>                <sequence type="adminui" action="caSetTargetDir"
>>>                condition="NOT TARGETDIR"
>>>                          value="120" />
>>>                <sequence type="installexecute" action="ConfigureLOC1"
>>>                value="750" condition="NOT Installed" /> <sequence
>>>                type="installexecute" action="ConfigureLOC2"
>>>                value="751" condition="NOT Installed" /> <sequence
>>>                type="installexecute" action="ConfigureDDL"
>>>                value="752" condition="NOT Installed" /> <sequence
>>>                type="installexecute" action="ConfigureDML"
>>>                value="753" condition="NOT Installed" />
>>>            </sequences>
>>>
>>> -----Original Message-----
>>> From: James Geurts [mailto:[EMAIL PROTECTED]
>>> Sent: Friday, September 17, 2004 8:34 AM
>>> To: Burton, Kevin
>>> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>>> Subject: RE: [NAntC-Dev] Installing .msi package from <msi> could not
>>> find DLL.
>>>
>>>
>>> I am pretty sure that dll custom actions cannot be written in c#.  I
>>> have only used .exe custom actions or dlls written in a non-dotnet
>>> language.  the microsoft.public.platformsdk.msi group might have a
>>> better idea of how to get a c# dll to work as a custom action (if
>>> possible).
>>>
>>> Other than that, what you're doing sounds right
>>>
>>> Jim





-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
NAntContrib-Developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer

Reply via email to