title: Web Setup - Installation Error
body: <p>I'm trying to install a web setup project generated in Visual studio 2008 in x86-64bit architecture and when i try to install it in a Windows 2003 server x64 says that cannot be installed and the setup exits. </p>
  
  <p>I checked the event log in Administrative tools and i found a general error message. later using verbose logging in msiexec.exe i found this:</p>
  
  <pre><code>(UNKNOWN)     La acción se inició a las 08:32:22: WEBCA_EvaluateURLsNoFail.
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Custom Action is starting...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: CoInitializeEx - COM initialization Apartment Threaded...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Enumerating table using SQL statement: 'SELECT * FROM `_UrlToDir`'
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Calling MsiGetActiveDatabase...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: MsiDatabaseOpenViewW - Prepare Database to view table...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: TMsiViewExecute - Open Database view on table...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: MsiRecordGetStringW - Fetching value...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: MsiRecordGetStringW - Getting value from column '1'...
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Getting App Root for Url Property: TARGETURL
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Getting AppRoot From Url key 'TARGETURL'.
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: MsiGetPropertyW - Determine size of property 'TARGETSITE'
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Property 'TARGETSITE' retrieved with value ''.
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: RESULT:
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: FAILED: -2147024809
  (UNKNOWN)     ERROR : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Custom Action failed with code: '87'
  (UNKNOWN)     INFO : [12/02/2011 08:32:22:609] [EvaluateURLsNoFail ]: Custom Action completed with return code: '87'
  (UNKNOWN)     DEBUG: Error 2769: Custom Action WEBCA_EvaluateURLsNoFail did not close 1 MSIHANDLEs. 
  </code></pre>
  
  <p>any ideas how to workaround this ?</p>
  
  <h2>Update (specific issue source)</h2>
  
  <p>The query <code>SELECT * FROM '_UrlToDir'</code> retrieves the default values for the IIS metabase configuration <code>LM/W3SVC/1/ROOT/3001</code>. the problem is taht MSI Websetup projects ALLWAYS ASUMES that the default website has <code>1</code> as id in your metabase, if by any reason this config doesn't exists or it's corrupted then the error occurs.</p>
  
  <p>In my specific case my problems occurred because i have installed Crystal Reports 2008 Runtime and later installed a WSUS server in my production web server. </p>
  
  <p>Deducting what happened (because i don't have further information), WSUS moved my current running web server configuration instance to another id (don't know why need to do this), and obiously didn't detected the configuration that the Crystal Reports installer inserted into metabase, the result was a partial config migration of my former web site into another id, WSUS inserted his own id (BTW Not id <code>1</code>) and keep the id <code>1</code> with a corrupted config information.</p>
  
  <h2>Possible solution</h2>
  
  <p>Using the metabase explorer included in IIS 6 resource kit to find the invalid ID and try to delete it, then using the IIS administrator scripts try to move the running configuration back to the id <code>1</code> using the following command:</p>
  
  <pre><code>CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs STOP_SERVER W3SVC/[OLD_ID]
  CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs MOVE W3SVC/[OLD_ID] W3SVC/[NEW_ID]
  CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs START_SERVER W3SVC/[NEW_ID]
  </code></pre>
  
  <p>I'm really afraid that something goes really ugly at this point, i will try it at some point in the future but not now.</p>