-All- I'm kinda new to WiX and can't seem to figure out how the script GetSites is actually being called. Do I need to create a custom action for the script and set it to execute immediately. Any help or more complete sample would be great.
Thanks for everyone's help in advance. I really appreciate it. John -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Diego Cadenas Sent: Friday, July 01, 2005 5:35 PM To: Valery Drotenko; wix-users@lists.sourceforge.net Subject: RE: [WiX-users] Re: Creating a virtual directory under a web site (other than the default) (by Mark Jones) Hi Valery, I'm having the same problem as Mark Jones. I'm trying to create a virtual directory on a windows 2003 server. I want to be able to create this virtual directory in any of the existing websites and if necessary create my own website. I am using a script posted in this mailing list. It populates my combo box with the existing websites but for some reason when I select them, the property is not set for that selection and it installs the virtual directory in the default website. Hopefully this makes sense: This is the script '======================================================================= ==== ' This Script Populates a ComboBox in the Windows Installer with the ' available IIS Websites in the local computer '======================================================================= ==== Const ERROR_SUCCESS = 0 Const ERROR_INSTALL_FAILURE = 1603 Const msiViewModifyInsertTemporary = 7 Function GetSites() Dim objIIS, oView, oSite, oServer, oReccombo Dim r On Error Resume Next Set objIIS = GetObject("IIS://localhost/W3SVC") If Err.Number <> 0 Then MsgBox "Unable to open IIS W3SVC Root object - " & _ "please ensure that IIS is running" & vbCrLf & _ " - Error Details: " & Err.Description & " [Number:" & _ Hex(Err.Number) & "]", vbCritical, "Error" GetSites = ERROR_INSTALL_FAILURE Exit Function Else 'open and execute a view to the ListBox table Set oView = Session.Database.OpenView("SELECT * FROM `ComboBox`") Set oPropertyView = Session.Database.OpenView("SELECT * FROM `Property` WHERE [Property] ='TARGETWEBCOMBO'") oView.Execute oPropertyView.Execute oPropertyView.Fetch r = 0 For Each oSite in objIIS If oSite.Class = "IIsWebServer" Then r = r + 1 Set oServer=GetObject(oSite.ADsPath) 'if r = 1 Then Session.Property("TARGETWEBCOMBO")= oSite.Name Session.Property("SERVERCOMMENT") = oServer.Get("ServerComment") 'End if ' ' ComboBox record fields are Property, Order, Value, Text ' Set oReccombo = Session.Installer.CreateRecord(4) oReccombo.StringData(1) = "TARGETWEBCOMBO" oReccombo.IntegerData(2) = r oReccombo.StringData(3) = oSite.Name ' oReccombo.StringData(3) = oServer.Get("ServerComment") oReccombo.StringData(4) = oServer.Get("ServerComment") oView.Modify msiViewModifyInsertTemporary, oReccombo End If Next oView.Close 'return success to MSI GetSites = ERROR_SUCCESS End If 'clean up Set objIIS = Nothing Set oView = Nothing End Function This is my code in my main.wxs file: <Component Id="DefaultWebSite" Guid="090947B9-44CE-4115-86BE-224F638A6C44" Permanent="yes"> <WebSite Id="Web" Description="[SERVERCOMMENT[TARGETWEBCOMBO]]" Directory="WWW" ConfigureIfExists="no"> <WebAddress Id="*" IP="*" Port="80" /> </WebSite> </Component> <Component Id="CMSWebVirtualDirComponent" Guid="8370CF2B-B844-49f9-9943-B8B7F6D5677C" Permanent="no"> <WebVirtualDir Id="WebVirtualDir" Alias="[TARGETVDIR]" Directory="WWW" WebSite="Web"> <WebApplication Id="WebApplication" Name="ProductWeb" /> </WebVirtualDir> </Component> This is the code in my UI.wxs fragment: <Property Id="TARGETVDIR">ProductWeb</Property> <Property Id="TARGETVDIR2"><RegistrySearch Id="FindTargetVir" Type="raw" Root="HKLM" Key="Software\[CompanyName]\[ProductName]" Name="TARGETVDIR" /></Property> <Property Id="TARGETWEBCOMBO"></Property> <Property Id="TARGETWEBCOMBO2"><RegistrySearch Id="FindTargetWeb" Type="raw" Root="HKLM" Key="Software\[CompanyName]\[ProductName]" Name="TARGETWEBCOMBO" /></Property> <Dialog Id="VirtualDirDlg" Width="370" Height="270" Title="[ProductName]" TrackDiskSpace="no"> <Control Id="Next" ...</Control> <Control Id="Back" ...</Control> <Control Id="Cancel"> ... </Control> <Control Id="WebLabel"><Text>Website to install to:</Text></Control> <!--WebEdit2 displays the existing website. It gets this information from the registry " --> <Control Id="WebEdit" Type="Edit" ... Disabled="yes" Property="TARGETWEBCOMBO2"> <Text><![CDATA[TARGETWEBCOMBO2]]></Text> </Control> <!--WebEditCombo displays the available Websites on the local computer. user can only select one--> <Control Id="WebEditCombo" Type="ComboBox" Hidden="yes" Disabled="no" Sorted="no" Property="TARGETWEBCOMBO" Indirect="no" ComboList="yes"><Text><![CDATA[TARGETWEBCOMBO]]></Text> <Condition Action="show" ><![CDATA[(&FeatureVirDir = 3) AND NOT (!FeatureVirDir = 3)]]> AND NOT VersionNT = 502 </Condition> </Control> <!--WebEditCombo displays the available Websites and allows to create a website only if OS is Windows Server--> <Control Id="WebEditCombo2" Type="ComboBox" Hidden="yes" Disabled="no" Sorted="no" Property="TARGETWEBCOMBO" Indirect="no" ComboList="no"><Text><![CDATA[TARGETWEBCOMBO]]></Text> <Condition Action="show" ><![CDATA[(&FeatureVirDir = 3) AND NOT (!FeatureVirDir = 3)]]> AND VersionNT = 502 </Condition> </Control> <Control Id="VDirLabel" Type="Text"><Text>Virtual directory:</Text></Control> <Control Id="VDirEdit2" Type="Edit" Disabled="yes" Property="TARGETVDIR2"> <Text><![CDATA[TARGETVDIR2]]></Text> </Control> <Control Id="VDirEdit" Type="Edit" Hidden="yes" Disabled="no" Property="TARGETVDIR"> <Text><![CDATA[TARGETVDIR]]></Text> <Condition Action="show"><![CDATA[(&FeatureVirDir = 3) AND NOT (!FeatureVirDir = 3)]]></Condition> </Control> </Dialog> I am sorry this message is so long, hopefully someone can help me out Thanks Diego Cadenas -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Valery Drotenko Sent: Tuesday, June 21, 2005 6:58 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Re: Creating a virtual directory under a web site (other than the default) (by Mark Jones) Hi! It seems, WebSites are mapped to by their wwwroot paths. Try the following (make sure to adapt this to your namings): QUOTE <WebSite Id="websiteGTWY" Description="[propWebSiteServerComments[WEBSITE]]" Directory="INSTALLDIR"> <WebAddress Id="webaddrGTWY" Port="[WEBSITE_PORT]" /> </WebSite> UNQUOTE Pay attention to the presence of "Directory" attribute - this does the linkage. Good luck! Valery Drotenko mailto:[EMAIL PROTECTED] ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users