Thanks James. It worked. I was able to create multiple virtual directories from your code.
Thanks Again!! Manish -----Original Message----- From: James Geurts [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 4:45 AM To: 'Manish Gupta'; [EMAIL PROTECTED] Subject: RE: [NAntC-Dev] Creating Multiple VDirectories in a single msi task Hi Manish, Sorry for being a little slow with this response. You can either create your own custom action to handle creating the virtual directories & app roots, or you can use the msvbdpca.dll to do the dirty work. I would recommend using your own custom action dll, rather than the msvbdpca.dll (Cached at: http://www.biacreations.com/MSVBDPCA.DLL) as it is sort of unsupported. This dll comes from Visual Studio and is how web projects from VS.Net create virtual directories. But. if you want to use the msvbdpca.dll to create the virtual directory & app roots this might help: Have a look at the example (http://nant.sourceforge.net/wiki/index.php/sample%20build%20file) showing how to add a dialog & actions to create a virtual directory as an application root. I don't think you can setup multiple application roots per virtual directory. I think you can only set a virtual directory to be an application root or not. You can, however, set a sub-folder as an application root. So, say you want some structure like the following: http://localhost/BaseAppRoot http://localhost/BaseAppRoot/bin http://localhost/BaseAppRoot/SubAppRoot http://localhost/BaseAppRoot/SubAppRoot/bin The following "should" create this structure: <msi sourcedir="${output.dir}" license="license.rtf" output="${company.name}.${product.name}.msi" debug="true" 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="BaseAppRoot" /> <property name="TARGETPORT" value="80" /> <property name="TARGETVDIR2" value="SubAppRoot" /> <property name="TARGETPORT2" value="80" /> </properties> <directories> <directory name="D__BIN" foldername="bin" root="TARGETDIR" /> <directory name="D__SUBAPPROOT" foldername="SubAppRoot" root="TARGETDIR"> <directory name="D__SUBAPPROOT_BIN" foldername="bin" /> </directory> </directories> <components> <component name="C__MainFiles" id="{BB3B4E94-00E3-4442-BFEE-D135B6D4F046}" attr="2" directory="TARGETDIR" feature="F__DefaultFeature"> <key file="Test.xml" /> <fileset basedir="${source.dir}"> <includes name="*.*" /> </fileset> </component> <component name="C__BinFiles" id="{71757C52-DA2A-4b03-82A8-12E30022C651}" attr="2" directory="D__BIN" feature="F__DefaultFeature"> <key file="${company.name}.${product.name}.xml" /> <fileset basedir="${source.dir}\bin"> <includes name="*.*" /> </fileset> </component> <component name="C__SubAppRootFiles" id="{3A7BD302-15FE-4b67-BC34-6A290F17D2E5}" attr="2" directory="D__SUBAPPROOT" feature="F__DefaultFeature"> <key file="SomeImage.jpg" /> <fileset basedir="${source.dir}\SubAppRoot"> <includes name="*.*" /> </fileset> </component> <component name="C__SubAppRootBinFiles" id="{BAAED302-85FE-4b67-BC34-6A290F17EFSE}" attr="2" directory="D__SUBAPPROOT_BIN" feature="F__DefaultFeature"> <key file="someassembly.dll" /> <fileset basedir="${source.dir}\SubAppRoot\bin"> <includes name="*.*" /> </fileset> </component> </components> <!-- Adds the dialog used to specify the virtual directory name --> <dialogs> <dialog name="WebFolderDlg" 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="WebFolderDlg" name="BannerBitmap" type="Bitmap" x="0" y="0" width="374" height="44" attr="1" text="[BannerBitmap]" nextcontrol="VDirLabel" /> <control dialog="WebFolderDlg" name="Title" type="Text" x="15" y="6" width="200" height="15" attr="196611" text="[DlgTitleFont]Virtual Directory Information" /> <control dialog="WebFolderDlg" name="Description" type="Text" x="25" y="23" width="280" height="15" attr="196611" text="Please enter your virtual directory and port information." /> <control dialog="WebFolderDlg" name="BannerLine" type="Line" x="0" y="44" width="374" height="0" attr="1" /> <control dialog="WebFolderDlg" name="VDirLabel" type="Text" x="18" y="73" width="348" height="15" attr="3" text="&Virtual directory:" nextcontrol="Edit_VDir" /> <control dialog="WebFolderDlg" name="Edit_VDir" type="Edit" x="18" y="85" width="252" height="18" attr="7" property="TARGETVDIR" text="[TARGETVDIR]" nextcontrol="PortLabel" /> <control dialog="WebFolderDlg" name="PortLabel" type="Text" x="18" y="110" width="348" height="15" attr="3" text="&Port:" nextcontrol="Edit_Port" /> <control dialog="WebFolderDlg" name="Edit_Port" type="Edit" x="18" y="122" width="48" height="18" attr="7" property="TARGETPORT" text="[TARGETPORT]" nextcontrol="Back" /> <control dialog="WebFolderDlg" name="BottomLine" type="Line" x="0" y="234" width="374" height="0" attr="1" /> <control dialog="WebFolderDlg" name="Back" type="PushButton" x="180" y="243" width="56" height="17" attr="3" text="[ButtonText_Back]" nextcontrol="Next" /> <control dialog="WebFolderDlg" name="Next" type="PushButton" x="236" y="243" width="56" height="17" attr="3" text="[ButtonText_Next]" nextcontrol="Cancel" /> <control dialog="WebFolderDlg" name="Cancel" type="PushButton" x="304" y="243" width="56" height="17" attr="3" text="[ButtonText_Cancel]" nextcontrol="BannerBitmap" /> </controls> <controlconditions> <controlcondition dialog="WebFolderDlg" control="Back" action="Disable" condition="ShowUserRegistrationDlg=""" /> <controlcondition dialog="WebFolderDlg" control="Back" action="Enable" condition="ShowUserRegistrationDlg<>""" /> </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 <> 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="WebFolderDlg" condition="ProductID" /> <controlevent dialog="SetupTypeDlg" control="Back" name="NewDialog" argument="WebFolderDlg" condition="ShowWebFolderDlg <> 1" /> <controlevent dialog="SetupTypeDlg" control="Back" name="NewDialog" argument="WebFolderDlg" condition="ShowWebFolderDlg = 1" /> <controlevent dialog="WebFolderDlg" control="Cancel" name="SpawnDialog" argument="CancelDlg" order="0" /> <controlevent dialog="WebFolderDlg" control="Back" name="NewDialog" argument="LicenseAgreementDlg" condition="ShowUserRegistrationDlg<>1" order="0" /> <controlevent dialog="WebFolderDlg" control="Back" name="NewDialog" argument="UserRegistrationDlg" condition="ShowUserRegistrationDlg=1" order="0" /> <!-- Virtual Directory Control Events --> <controlevent dialog="WebFolderDlg" control="Next" name="DoAction" argument="WEBCA_CreateURLs" condition="1" order="0" /> <controlevent dialog="WebFolderDlg" control="Next" name="DoAction" argument="WEBCA_EvaluateURLsMB" condition="1" order="1" /> <controlevent dialog="WebFolderDlg" control="Next" name="SetTargetPath" argument="TARGETDIR" condition="1" order="2" /> <controlevent dialog="WebFolderDlg" control="Next" name="NewDialog" argument="SetupTypeDlg" condition="1" order="3" /> </controlevents> <!-- Add the dll required for virtual directory creation --> <binaries> <binary name="MSVBDPCADLL" value="${builds.dir}\MSVBDPCA.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="BaseAppRoot" /> <customaction action="WEBCA_TARGETPORT" type="307" source="TARGETPORT" target="80" /> <customaction action="WEBCA_TARGETVDIR2" type="307" source="TARGETVDIR" target="SubAppRoot" /> <customaction action="WEBCA_TARGETPORT2" type="307" source="TARGETPORT" target="80" /> </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=""" /> <sequence type="installexecute" action="WEBCA_TARGETPORT" value="750" condition="TARGETPORT=""" /> <sequence type="installexecute" action="WEBCA_TARGETVDIR2" value="750" condition="TARGETVDIR2=""" /> <sequence type="installexecute" action="WEBCA_TARGETPORT2" value="750" condition="TARGETPORT2=""" /> <sequence type="installexecute" action="WEBCA_CreateURLs" value="752" condition="NOT Installed" /> <sequence type="installexecute" action="WEBCA_EvaluateURLs" value="753" 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="installui" action="WEBCA_TARGETVDIR" value="750" condition="TARGETVDIR=""" /> <sequence type="installui" action="WEBCA_TARGETPORT" value="750" condition="TARGETPORT=""" /> <sequence type="installui" action="WEBCA_TARGETVDIR2" value="750" condition="TARGETVDIR2=""" /> <sequence type="installui" action="WEBCA_TARGETPORT2" value="750" condition="TARGETPORT2=""" /> <sequence type="installui" action="WEBCA_CreateURLs" value="752" condition="NOT Installed" /> <sequence type="installui" action="WEBCA_EvaluateURLsNoFail" value="753" condition="NOT Installed" /> <sequence type="adminexecute" action="WEBCA_TARGETVDIR" value="750" condition="TARGETVDIR=""" /> <sequence type="adminexecute" action="WEBCA_TARGETPORT" value="750" condition="TARGETPORT=""" /> <sequence type="adminexecute" action="WEBCA_TARGETVDIR2" value="750" condition="TARGETVDIR2=""" /> <sequence type="adminexecute" action="WEBCA_TARGETPORT2" value="750" condition="TARGETPORT2=""" /> <sequence type="adminexecute" action="WEBCA_CreateURLs" value="752" condition="NOT Installed" /> <sequence type="adminexecute" action="WEBCA_EvaluateURLs" value="753" condition="NOT Installed" /> <sequence type="adminui" action="WEBCA_TARGETVDIR" value="750" condition="TARGETVDIR=""" /> <sequence type="adminui" action="WEBCA_TARGETPORT" value="750" condition="TARGETPORT=""" /> <sequence type="adminui" action="WEBCA_TARGETVDIR2" value="750" condition="TARGETVDIR2=""" /> <sequence type="adminui" action="WEBCA_TARGETPORT2" value="750" condition="TARGETPORT2=""" /> <sequence type="adminui" action="WEBCA_CreateURLs" value="752" condition="NOT Installed" /> <sequence type="adminui" action="WEBCA_EvaluateURLsNoFail" value="753" condition="NOT Installed" /> </sequences> <!-- Represents URL properties as a property --> <urlproperties> <urlproperty name="TARGETURL" property="TARGETDIR" /> <urlproperty name="TARGETURL2" property="D__SUBAPPROOT" /> </urlproperties> <!-- Represents VDir properties as a URL --> <vdirproperties> <vdirproperty name="TARGETVDIR" portproperty="TARGETPORT" urlproperty="TARGETURL" /> <vdirproperty name="TARGETVDIR2" portproperty="TARGETPORT2" urlproperty="TARGETURL2" /> </vdirproperties> <!-- Creates an application root --> <approots> <approot component="C__MainFiles" urlproperty="TARGETURL" inprocflag="2" /> <approot component="C__SubAppRootFiles" urlproperty="TARGETURL2" inprocflag="2" /> </approots> <!-- Set the directory properties for IIS --> <iisproperties> <iisproperty directory="TARGETDIR" attr="626" defaultdoc="Default.aspx" /> <iisproperty directory="D__BIN" attr="112" /> <iisproperty directory="D__SUBAPPROOT" attr="626" defaultdoc="Default.aspx" /> <iisproperty directory="D__SUBAPPROOT_BIN" attr="112" /> </iisproperties> <features> <feature name="F__DefaultFeature" title="${product.name} Main Feature" display="1" typical="true" directory="TARGETDIR"> <description>${product.name} core files.</description> </feature> </features> </msi> ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ NAntContrib-Developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer