Hi,

I am trying to create a msi using nantcontrib. 

As per the requirements, I need to ask user for the username and
password for a database on which I have to perform some tasks. 

So I have made a custom action dll, which takes the values from the a
custom dialog and passes the values which are then read by my dll using
the MsiGetProperty(..) function.

However, the property values read by my dll are the default values that
I assigned to the property names which defining them and not the updated
values which the user sets during installation.

Can you please tell as to where am I wrong?

Also I tried defining the property as dynamic, but it throws an
exception of attribute not defined.

Any help would be highly appreciated.

Thanks
Manish



C++ Code snip:
        MsiGetProperty(hModule, "DBUserName", szUsername, &dwLen);


Nant script:
<project name="PRODUCTInstaller" default="msi" >

    <property name="product.name" value="PRODUCT" />
    <property name="company.name" value="COMPANY"         />
    <property name="msi.version"  value="1.0.4.2" />

    <property name="msi.virtualdirectory.name"  value="PRODUCT"
/>
    <property name="msi.virtualdirectory.name1" value="COMPANYAdmin"
/>
    <property name="msi.virtualdirectory.name2"
value="COMPANYVaccination" />

    <property name="msi.guid.product"
value="{B9D2CE19-9CF2-4663-921A-8C3D97A8B9E8}" />
    <property name="msi.guid.upgrade"
value="{33C71A5C-DC86-4d79-95A7-14FED9720F9B}" />

    <property name="MDBUserName"        value="1" dynamic="true"
/>
    <property name="MDBPassword"        value="2" />
    <property name="MDBPath"            value="3" />

    <!-- A directory containing files to support builds -->
    <property name="builds.dir" value="." />

    <!-- A directory containing source files to include in the msi -->
    <property name="source.dir" value=".." />

    <!-- Location to output the complete msi -->
<!--    <property name="output.dir" value="./installer" />-->
    <property name="output.dir" value="./installer" />

    <target name="msi" description="Builds a MSI install">

        <msi
            sourcedir="${source.dir}"
            license="license.rtf"
            output="${output.dir}/${company.name}.${product.name}.msi"
            debug="false"
            verbose="true"
        >
            <properties>
                <property name="ProductName"    value="${product.name}"
/>
                <property name="ProductVersion" value="${msi.version}"
/>
                <property name="Manufacturer"   value="${company.name}"
/>
                <property name="ProductCode"
value="${msi.guid.product}" />
                <property name="UpgradeCode"
value="${msi.guid.upgrade}" />

                <property name="TARGETVDIR"
value="${msi.virtualdirectory.name}" />
                <property name="TARGETPORT"     value="80" />
                <property name="TARGETVDIR1"
value="${msi.virtualdirectory.name1}" />
                <property name="TARGETPORT1"    value="80" />
                <property name="TARGETVDIR2"
value="${msi.virtualdirectory.name2}" />
                <property name="TARGETPORT2"    value="80" />

                <property name="DBUserName"     value="${MDBUserName}"
/>
                <property name="DBPassword"     value="${MDBPassword}"
/>
                <property name="DBPath"         value="${MDBPath}" />

           </properties>

          <directories>

                <directory name="D__ADMIN" foldername="COMPANYAdmin"
root="TARGETDIR">
                        <directory name="D__ADMIN_IMAGES"
foldername="images" />
                        <directory name="D__ADMIN_BIN"
foldername="bin" />
                        <directory name="D__ADMIN_TEMP"
foldername="tempDir" />
                </directory>

                <directory name="D__VAC" foldername="webapp"
root="TARGETDIR">
                        <directory name="D__VAC_BIN"
foldername="bin" />
                        <directory name="D__VAC_COMMON"
foldername="CommonFiles" />
                        <directory name="D__VAC_TEMP"
foldername="tempDir" />
                </directory>
           </directories>

          <features>
                <feature name="F__Admin" title="Admin Site" display="1"
typical="true" directory="TARGETDIR">
                        <description>Admin Site core
files.</description>
                </feature>
                <feature name="F__Vac" title="Device Site" display="1"
typical="true" directory="TARGETDIR">
                        <description>Device Site core
files.</description>
                </feature>
        </features>


            <components>
                <component name="C__MainFiles"
id="{BB3B4E94-00E3-4442-BFEE-D135B6D4F061}" attr="2"
directory="TARGETDIR" feature="F__Admin">
                        <key file="Web.config" />
                        <fileset basedir="${source.dir}">
                                <includes name="*.config" />
                        </fileset>
                </component>

                 <component name="C__Admin_Files"
id="{BB3B4E94-00E3-4442-BFEE-D135B6D4F048}" attr="2"
directory="D__ADMIN" feature="F__Admin">
                    <key file="login.aspx" />
                    <fileset basedir="${source.dir}\COMPANYAdmin">
                        <includes name="*.aspx" /> 
                        <includes name="*.ascx" /> 
                        <includes name="*.js" /> 
                        <includes name="*.htm" /> 
                        <includes name="*.xml" /> 
                        <includes name="*.css" /> 
                        <includes name="*.asax" /> 
                        <includes name="*.config" /> 
                        <includes name="*.log4net" /> 
                        <includes name="*.LWL" /> 
                    </fileset>
                </component>

                <component name="C__Admin_Bin"
id="{71757C52-DA2A-4b03-82A8-12E30022C659}" attr="2"
directory="D__ADMIN_BIN" feature="F__Admin">
                    <key file="key.txt" />
                    <fileset basedir="${source.dir}\COMPANYAdmin\bin">
                        <includes name="*.dll" />
                        <includes name="*.txt" />
                    </fileset>
                </component>

               <component name="C__Admin_Temp"
id="{71757C52-DA2A-4b03-82A8-12E30022C663}" attr="2"
directory="D__ADMIN_TEMP" feature="F__Admin">
                    <key file="noimage.JPG" />
                    <fileset
basedir="${source.dir}\COMPANYAdmin\images">
                        <includes name="noimage.JPG" />
                    </fileset>
                </component>


               <component name="C__Vac_Temp"
id="{71757C52-DA2A-4b03-82A8-12E30022C665}" attr="2"
directory="D__VAC_TEMP" feature="F__Vac">
                    <key file="noimage.JPG" />
                    <fileset
basedir="${source.dir}\COMPANYAdmin\images">
                        <includes name="noimage.JPG" />
                    </fileset>
                </component>

                <component name="C__Admin_Images"
id="{3A7BD302-15FE-4b67-BC34-6A290F17D2F1}" attr="2"
directory="D__ADMIN_IMAGES" feature="F__Admin">
                    <key file="noimage.JPG" />
                    <fileset
basedir="${source.dir}\COMPANYAdmin\images">
                        <includes name="*.gif" />
                        <includes name="*.GIF" />
                        <includes name="*.jpg" />
                        <includes name="*.JPG" />
                    </fileset>
                </component>


                <component name="C__Vac_Files"
id="{BB3B4E94-00E3-4442-BFEE-D135B6D4F046}" attr="2" directory="D__VAC"
feature="F__Vac">
                    <key file="Decision.aspx" />
                    <fileset basedir="${source.dir}\webapp">
                        <includes name="*.aspx" /> 
                        <includes name="*.ascx" /> 
                        <includes name="*.js" /> 
                        <includes name="*.htm" /> 
                        <includes name="*.xml" /> 
                        <includes name="*.css" /> 
                        <includes name="*.asax" /> 
                        <includes name="*.config" /> 
                        <includes name="*.log4net" /> 
                        <includes name="*.LWL" /> 
                       </fileset>
                </component>

                <component name="C__Vac_Bin"
id="{71757C52-DA2A-4b03-82A8-12E30022C653}" attr="2"
directory="D__VAC_BIN" feature="F__Vac">
                    <key file="key1.txt" />
                    <fileset basedir="${source.dir}\webapp/bin">
                        <includes name="*.dll" />
                        <includes name="*.txt" />
                    </fileset>
                </component>

               <component name="C__Vac_Common"
id="{71757C52-DA2A-4b03-82A8-12E30022C655}" attr="2"
directory="D__VAC_COMMON" feature="F__Vac">
                    <key file="COMPANY Logo_hh.gif" />
                    <fileset basedir="${source.dir}\webapp/CommonFiles">
                        <includes name="*.gif" />
                    </fileset>
                </component>
            </components>

             <!-- Adds the dialog used to specify the virtual directory
name -->
            <dialogs>
                <dialog name="DBInfoDlg" hcenter="50" vcenter="50"
width="370" height="270" attr="39"
                        title="[ProductName] [Setup]"
firstcontrol="Next" defaultcontrol="Next" cancelcontrol="Cancel" />
            </dialogs>

            <!-- Adds the controls associated with the dialog -->
            <controls>
                <control dialog="DBInfoDlg" name="BannerBitmap"
type="Bitmap" x="0"  y="0"   width="374" height="44" attr="1"
text="[BannerBitmap]" nextcontrol="unameLabel" />
                <control dialog="DBInfoDlg" name="Title"
type="Text"   x="15" y="6"   width="200" height="15" attr="196611"
text="[DlgTitleFont]Database Information" />
                <control dialog="DBInfoDlg" name="Description"
type="Text"   x="25" y="23"  width="280" height="15" attr="196611"
text="Please enter your database information." />
                <control dialog="DBInfoDlg" name="BannerLine"
type="Line"   x="0"  y="44"  width="374" height="0"  attr="1" />
                <control dialog="DBInfoDlg" name="unameLabel"
type="Text"   x="18" y="73"  width="348" height="15" attr="3"
text="&amp;User Name:"                          nextcontrol="Edit_uname"
/>
                <control dialog="DBInfoDlg" name="Edit_uname"
type="Edit"   x="18" y="85"  width="252" height="18" attr="7"
property="DBUserName"                           text="[DBUserName]"
nextcontrol="PassLabel" />
                <control dialog="DBInfoDlg" name="PassLabel"
type="Text"   x="18" y="110" width="348" height="15" attr="3"
text="&amp;Password:"                   nextcontrol="Edit_Pass" />
                <control dialog="DBInfoDlg" name="Edit_Pass"
type="Edit"   x="18" y="122" width="252" height="18" attr="7"
property="DBPassword"                           text="[DBPassword]"
nextcontrol="PathLabel" />
                <control dialog="DBInfoDlg" name="PathLabel"
type="Text"   x="18" y="147" width="348" height="15" attr="3"
text="&amp;Path of Oracle binaries:"       nextcontrol="Edit_Path" />
                <control dialog="DBInfoDlg" name="Edit_Path"
type="Edit"   x="18" y="159" width="252" height="18" attr="7"
property="DBPath"                       text="[DBPath]"
nextcontrol="Back" />


                <control dialog="DBInfoDlg" name="BottomLine"
type="Line"                    x="0" y="234" width="374" height="0"
attr="1" />
                <control dialog="DBInfoDlg" name="Back"
type="PushButton"                    x="180" y="243" width="56"
height="17" attr="3"                    text="[ButtonText_Back]"
nextcontrol="Next" />
                <control dialog="DBInfoDlg" name="Next"
type="PushButton"                    x="236" y="243" width="56"
height="17" attr="3"                    text="[ButtonText_Next]"
nextcontrol="Cancel" />
                <control dialog="DBInfoDlg" name="Cancel"
type="PushButton"                    x="304" y="243" width="56"
height="17" attr="3"                    text="[ButtonText_Cancel]"
nextcontrol="BannerBitmap" />

            </controls>

            <controlconditions>
                <controlcondition dialog="DBInfoDlg" control="Back"
action="Disable"
condition="ShowUserRegistrationDlg=&quot;&quot;" />
                <controlcondition dialog="DBInfoDlg" control="Back"
action="Enable"
condition="ShowUserRegistrationDlg&lt;&gt;&quot;&quot;" />
            </controlconditions>


           <!-- Make sure the dialog is put into the execute order -->

            <controlevents>
                <!-- Remove the old control events -->
                <controlevent dialog="UserRegistrationDlg"
control="Next"          name="NewDialog"        argument="SetupTypeDlg"
condition="ProductID"                   remove="true" />
                <controlevent dialog="SetupTypeDlg"
control="Back"          name="NewDialog"
argument="LicenseAgreementDlg"  condition="ShowUserRegistrationDlg
&lt;&gt; 1" remove="true" />
                <controlevent dialog="SetupTypeDlg"
control="Back"          name="NewDialog"
argument="UserRegistrationDlg"  condition="ShowUserRegistrationDlg = 1"
remove="true" />

                <!-- Add new control events for the new dialog -->
                <controlevent dialog="UserRegistrationDlg"
control="Next"          name="NewDialog"        argument="DBInfoDlg"
condition="ProductID" />
                <controlevent dialog="UserRegistrationDlg"
control="Next"          name="NewDialog"        argument="DBInfoDlg"
/>
                <controlevent dialog="SetupTypeDlg"
control="Back"          name="NewDialog"        argument="DBInfoDlg"
/>
                <controlevent dialog="DBInfoDlg"
control="Cancel"        name="SpawnDialog"      argument="CancelDlg"
order="0" />
                <controlevent dialog="DBInfoDlg"
control="Back"          name="NewDialog"
argument="LicenseAgreementDlg"
condition="ShowUserRegistrationDlg&lt;&gt;1"    order="0" />
                <controlevent dialog="DBInfoDlg"
control="Back"          name="NewDialog"
argument="UserRegistrationDlg"  condition="ShowUserRegistrationDlg=1"
order="0" />
                <controlevent dialog="DBInfoDlg"
control="Next"          name="NewDialog"        argument="SetupTypeDlg"
condition="1"                                   order="0" />
            </controlevents>

            <!-- Set the registry keys -->
            <registry>
                <key
path="SOFTWARE\${company.name}\${product.name}\${msi.version}\"
                    root="machine" component="C__MainFiles">
                    <value name="ProductDir" value="[TARGETDIR]" />
                    <value name="VirtualDir" value="[TARGETVDIR]" />
                    <value name="Port" value="[TARGETPORT]" />
                    <value name="URL" value="[TARGETURL]" />
                </key>
            </registry>

             <!-- Add the dll required for virtual directory creation
-->
            <binaries>
                <binary name="MSVBDPCADLL"
value="${builds.dir}\MSVBDPCA.DLL" />
                <binary name="COMPANY_CA_DB"
value="${builds.dir}\CA_COMPANY_DB.dll" />
            </binaries>

            <!-- Adds custom actions -->
            <customactions>
                <customaction action="WEBCA_GatherWebFolderProperties"
type="1"        source="MSVBDPCADLL"
target="GatherWebFolderProperties" />
                <customaction action="WEBCA_ApplyWebFolderProperties"
type="1537"     source="MSVBDPCADLL"
target="ApplyWebFolderProperties" />
                <customaction
action="WEBCA_RollbackApplyWebFolderProperties"         type="1281"
source="MSVBDPCADLL"    target="RollbackApplyWebFolderProperties" />
                <customaction action="WEBCA_CreateURLs"
type="1"        source="MSVBDPCADLL"    target="CreateURLs" />
                <customaction action="WEBCA_EvaluateURLs"
type="1"        source="MSVBDPCADLL"    target="EvaluateURLs" />
                <customaction action="WEBCA_EvaluateURLsNoFail"
type="1"        source="MSVBDPCADLL"    target="EvaluateURLsNoFail" />
                <customaction action="WEBCA_EvaluateURLsMB"
type="1"        source="MSVBDPCADLL"    target="EvaluateURLsMB" />
                <customaction action="WEBCA_CreateAppRoots"
type="1"        source="MSVBDPCADLL"    target="CreateAppRoots" />
                <customaction action="WEBCA_TARGETVDIR"
type="307"      source="TARGETVDIR"
target="${msi.virtualdirectory.name}" />
                <customaction action="WEBCA_TARGETPORT"
type="307"      source="TARGETPORT"     target="80" />
                <customaction action="WEBCA_TARGETVDIR1"
type="307"      source="TARGETVDIR"
target="${msi.virtualdirectory.name1}" />
                <customaction action="WEBCA_TARGETPORT1"
type="307"      source="TARGETPORT"     target="80" />
                <customaction action="WEBCA_TARGETVDIR2"
type="307"      source="TARGETVDIR"
target="${msi.virtualdirectory.name2}" />
                <customaction action="WEBCA_TARGETPORT2"
type="307"      source="TARGETPORT"     target="80" />
                <customaction action="CA_Username"
type="307"      source="DBUserName"     target="${MDBUserName}" />
                <customaction action="COMPANYDBInstall"
type="1"        source="COMPANY_CA_DB"  target="DBInstall" />

            </customactions>

            <!-- Adds the sequence to run certain actions -->
            <sequences>
                <!-- This is executed after clicking "install" and when
you see the progress bar. -->
                <sequence type="installexecute"
action="WEBCA_TARGETVDIR"                       value="750"
condition="TARGETVDIR=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_TARGETPORT"                       value="750"
condition="TARGETPORT=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_TARGETVDIR1"                      value="751"
condition="TARGETVDIR1=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_TARGETPORT1"                      value="751"
condition="TARGETPORT1=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_TARGETVDIR2"                      value="752"
condition="TARGETVDIR2=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_TARGETPORT2"                      value="752"
condition="TARGETPORT2=&quot;&quot;" />
                <sequence type="installexecute"
action="WEBCA_CreateURLs"                       value="753"
condition="NOT Installed" />
                <sequence type="installexecute"
action="WEBCA_EvaluateURLs"                     value="754"
condition="NOT Installed" />
                <sequence type="installexecute"
action="WEBCA_GatherWebFolderProperties"           value="3701"
condition="NOT Installed" />
                <sequence type="installexecute"
action="WEBCA_ApplyWebFolderProperties"            value="3701"
condition="NOT Installed" />
                <sequence type="installexecute"
action="WEBCA_RollbackApplyWebFolderProperties"         value="3701"
condition="NOT Installed" />
                <sequence type="installexecute"
action="WEBCA_CreateAppRoots"                           value="3701"
condition="NOT Installed" />

                <sequence type="installexecute"
action="CA_Username"                                    value="751"
condition="DBUserName=&quot;&quot;" />
                <sequence type="installexecute"
action="COMPANYDBInstall"                               value="4550"
condition="NOT Installed" />

                <sequence type="installui"
action="WEBCA_TARGETVDIR"                       value="750"
condition="TARGETVDIR=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_TARGETPORT"                       value="750"
condition="TARGETPORT=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_TARGETVDIR1"                      value="751"
condition="TARGETVDIR1=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_TARGETPORT1"                      value="751"
condition="TARGETPORT1=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_TARGETVDIR2"                      value="752"
condition="TARGETVDIR2=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_TARGETPORT2"                      value="752"
condition="TARGETPORT2=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_CreateURLs"                       value="753"
condition="NOT Installed" />
                <sequence type="installui"
action="CA_Username"                                    value="751"
condition="DBUserName=&quot;&quot;" />
                <sequence type="installui"
action="WEBCA_EvaluateURLsNoFail"                  value="754"
condition="NOT Installed" />

                <sequence type="adminexecute"
action="WEBCA_TARGETVDIR"                       value="750"
condition="TARGETVDIR=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_TARGETPORT"                       value="750"
condition="TARGETPORT=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_TARGETVDIR1"                      value="751"
condition="TARGETVDIR1=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_TARGETPORT1"                      value="751"
condition="TARGETPORT1=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_TARGETVDIR2"                      value="752"
condition="TARGETVDIR2=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_TARGETPORT2"                      value="752"
condition="TARGETPORT2=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_CreateURLs"                       value="753"
condition="NOT Installed" />
                <sequence type="adminexecute"
action="CA_Username"                                    value="751"
condition="DBUserName=&quot;&quot;" />
                <sequence type="adminexecute"
action="WEBCA_EvaluateURLs"                     value="754"
condition="NOT Installed" />

                <sequence type="adminui"
action="WEBCA_TARGETVDIR"                       value="750"
condition="TARGETVDIR=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_TARGETPORT"                       value="750"
condition="TARGETPORT=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_TARGETVDIR1"                      value="751"
condition="TARGETVDIR1=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_TARGETPORT1"                      value="751"
condition="TARGETPORT1=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_TARGETVDIR2"                      value="752"
condition="TARGETVDIR2=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_TARGETPORT2"                      value="752"
condition="TARGETPORT2=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_CreateURLs"                       value="753"
condition="NOT Installed" />
                <sequence type="adminui"
action="CA_Username"                                    value="751"
condition="DBUserName=&quot;&quot;" />
                <sequence type="adminui"
action="WEBCA_EvaluateURLsNoFail"                  value="754"
condition="NOT Installed" />

            </sequences>

            <!-- Represents URL properties as a property -->
            <urlproperties>
                <urlproperty name="TARGETURL" property="TARGETDIR" />
                <urlproperty name="TARGETURL1" property="D__ADMIN" />
                <urlproperty name="TARGETURL2" property="D__VAC" />
           </urlproperties>

            <!-- Represents VDir properties as a URL -->
            <vdirproperties>
                <vdirproperty name="TARGETVDIR"
portproperty="TARGETPORT"  urlproperty="TARGETURL" />
                <vdirproperty name="TARGETVDIR1"
portproperty="TARGETPORT1" urlproperty="TARGETURL1" />
                <vdirproperty name="TARGETVDIR2"
portproperty="TARGETPORT2" urlproperty="TARGETURL2" />
            </vdirproperties>

            <!-- Creates an application root -->
            <approots>
                <approot component="C__MainFiles"
urlproperty="TARGETURL"   inprocflag="2" />
                <approot component="C__Admin_Files"
urlproperty="TARGETURL1"  inprocflag="2" />
                <approot component="C__Vac_Files"
urlproperty="TARGETURL2"  inprocflag="2" />
            </approots>

            <!-- Set the directory properties for IIS -->
            <iisproperties>

                <iisproperty directory="TARGETDIR"
attr="630" />
                <iisproperty directory="D__ADMIN"
attr="630"  defaultdoc="login.aspx" />
                <iisproperty directory="D__ADMIN_IMAGES"
attr="115" />
                <iisproperty directory="D__ADMIN_BIN"
attr="112" />
                <iisproperty directory="D__VAC"
attr="630"  defaultdoc="login.aspx" />
                <iisproperty directory="D__VAC_BIN"
attr="112" />
                <iisproperty directory="D__VAC_COMMON"
attr="115" />
                <iisproperty directory="D__VAC_TEMP"
attr="119" />
                <iisproperty directory="D__ADMIN_TEMP"
attr="119" />

            </iisproperties>


        </msi>
    </target>
</project>





-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
NAntContrib-Developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer

Reply via email to