I am in the process of adding a mechanism to the WebSite element 
processing to get the current directory for an exiting web site and set 
a Property / Directory; here are my thoughts / design - any advice / 
recommendations would be GREATLY appreciated.

* Add a SetDirectoryIfExists yes / no attribute to WebSite

This translates into a Short column in IIsWebSite called SetDir (0 = no. 
1 = yes).

* If any WebSite elements have SetDirectoryIfExists="yes", add the 
following CustomAction and sequence entries (presented here as their WiX 
equivalents):

<CustomAction Id="SetWebSiteDirs" BinaryKey="IIsSchedule" 
DllEntry="SetWebSiteDirs" Execute="firstSequence" Return="check" 
SuppressModularization="yes" />

<InstallExecuteSequence>
  <Custom Action="SetWebSiteDirs" After="AppSearch" 
Overridable="yes">VersionNT &gt; 400</Custom>
</InstallExecuteSequence>

<InstallUISequence>
  <Custom Action="SetWebSiteDirs" After="AppSearch" 
Overridable="yes">VersionNT &gt; 400</Custom>
</InstallUISequence>

I want the action sequence to be overridable in the unlikely case that 
one requires the information prior to AppSearch; I will have to see how 
the compiler handles this in order to duplicate the proper behavior.

* SetWebSiteDirs does the following for each IISWebSite record where 
SetDir <> 0:

1) Call ScaWebFindBase to get the matching metabase path

If the web site doesn't exist, I plan to rely on the current processing 
to throw an error as necessary; if the site is part of a Component, then 
a new site will be created using the directory logic already in place.  
If the site isn't, then the current logic is supposed to throw an error.

I will add logic to return an error in the case where content is being 
added to a site without any metabase configuration, since I'm pretty 
sure the current compilation process will not schedule any IIS Custom 
Actions.

2) Read Path (MD_VR_PATH, METADATA_INHERIT, IIS_MD_UT_FILE, 
STRING_METADATA) from <Path From Step 1>/Root

3) Write result Step 2 to a Property / TargetPath referenced by 
IIsWebSite.Directory_

Which is better, writing to a property with WcaSetProperty / 
MsiSetProperty or writing to a directory with MsiSetTargetPath?  I know 
that there are caveats for overwriting a directory during a Maintenance 
install (don't do it); does the same exist for properties?

Can anyone think of anything else I need to watch out for?

Thanks,

-- 
Thomas S. Trias
Senior Developer
Artizan Internet Services
http://www.artizan.com/


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to