title: Error URL for Prerrequisites Setup.exe Click Once VS 2008
body: <p>I have this trouble:</p>
  
  <p>I am using VS 2008 Team Suite, and I have WinForms csproj. I want Publish it using ClickOnce.</p>
  
  <p>In Publish Properties of csproj, I have these values:</p>
  
  <blockquote>
    <p>Publishing Folder Location (web site,
    ftp server, or file path):
    C:\ClickOnce\Frk.Security.CarWin.WebInstall\Publicacion\</p>
    
    <p>Installation Folder URL (if different
    than above):
    <a href="http://CHANGETHESERVER/carwinclickonce/Publicacion/" rel="nofollow noreferrer">http://CHANGETHESERVER/carwinclickonce/Publicacion/</a></p>
    
    <p>Publish Version: 1.0.0.0</p>
    
    <p>Prerrequisites: Windows Installer 3.1,
    .NET 35. sp1</p>
  </blockquote>
  
  <p>Now, I publish and all is OK. I need deploy my app to several machines (Development, Preproduction, production environments...), and I use Msbuild...</p>
  
  <pre><code>&lt;Microsoft.Sdc.Tasks.Folder.CopyFolder
      Source="Publicacion"
      Destination="$(Directorio_Destination)\Publicacion" /&gt;
  </code></pre>
  
  <p>I copy <code>C:\ClickOnce\Frk.Security.CarWin.WebInstall\Publicacion\</code> to another machine, in folder (this folder is root of a Web Site)  </p>
  
  <pre><code>\\desiis\c$\Webs\carwinclickonce\Publicacion\ 
  </code></pre>
  
  <p>(<a href="http://desiis/carwinclickonce/Publicacion/" rel="nofollow noreferrer">http://desiis/carwinclickonce/Publicacion/</a>)</p>
  
  <p>I use MSBUILD and Mage like this; variable $(ProviderUrl) = <a href="http://desiis/carwinclickonce/Publicacion/" rel="nofollow noreferrer">http://desiis/carwinclickonce/Publicacion/</a></p>
  
  <pre><code>&lt;Target Name="PublishClickOnce"&gt;
      &lt;Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" /&gt;
  
      &lt;Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx" /&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>Now, I have my publish.htm in <a href="http://desiis/carwinclickonce/Publicacion/publish.htm" rel="nofollow noreferrer">http://desiis/carwinclickonce/Publicacion/publish.htm</a>.</p>
  
  <p>There are two links to install application:
  1. ) <a href="http://desiis/Carwinclickonce/Publicacion/Frk.Security.CarWin.application" rel="nofollow noreferrer">http://desiis/Carwinclickonce/Publicacion/Frk.Security.CarWin.application</a></p>
  
  <p>Everything is OK for this option.</p>
  
  <ol start="2">
  <li>) <a href="http://desiis/Carwinclickonce/Publicacion/Setup.exe" rel="nofollow noreferrer">http://desiis/Carwinclickonce/Publicacion/Setup.exe</a></li>
  </ol>
  
  <p>This option gets errors!</p>
  
  <p>The errors are the following:</p>
  
  <blockquote>
    <p>Error al intentar descargar
    '<a href="http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application" rel="nofollow noreferrer">http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application</a>'.
    (FAILS when try download
    'http....Frk.Security.CarWin.application')</p>
    
    <p>Vea el archivo de registro de la
    instalación que se encuentra en
    'C:\DOCUME~1\xxxxxx\CONFIG~1\Temp\VSD5B7.tmp\install.log'
    para obtener más información.</p>
  </blockquote>
  
  <p>install.log contents:</p>
  
  <blockquote>
    <p>The following properties have been
    set: Property: [AdminUser] = true
    {boolean} Property:
    [ProcessorArchitecture] = Intel
    {string} Property: [VersionNT] = 5.1.3
    {version} Running checks for package
    'Windows Installer 3.1', phase</p>
    
    <p>BuildList The following properties
    have been set for package 'Windows
    Installer 3.1': Running checks for
    command
    'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
    Result of running operator
    'VersionGreaterThanOrEqualTo' on
    property 'VersionMsi' and value '3.1':
    true Result of checks for command
    'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
    is 'Bypass' 'Windows Installer 3.1'
    RunCheck result: No Install Needed</p>
    
    <p>Launching Application.
    URLDownloadToCacheFile failed with
    HRESULT '-2146697211' Error: Error al
    intentar descargar
    '<a href="http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application" rel="nofollow noreferrer">http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application</a>'.
    (FAILS when try download
    'http....Frk.Security.CarWin.application')</p>
  </blockquote>
  
  <p>Any ideas?  Can I use Mage.exe commands?  How can I modify setup.exe?</p>
  
  <p>Update:</p>
  
  <p>use msbuild for using setup -url=<a href="http://desiis/" rel="nofollow noreferrer">http://desiis/</a>....</p>
  
  <pre><code>&lt;Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)" /&gt;
  </code></pre>
  
  <p>Another problem is that after using the /url switch to change out the URL, a message box appears for manually confirming that the signature will be invalided for the assembly.</p>
  
  <ol>
  <li>How can use setup -url=http://.... in silent mode?</li>
  <li>How can I sign the setup.exe again?</li>
  </ol>
  
  <p>My msbuild</p>
  
  <pre><code>&lt;Target Name="PublishClickOnce"&gt;
  
  &lt;Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)" /&gt; 
  &lt;Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" /&gt; 
  &lt;Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx" /&gt; 
  
  &lt;/Target&gt;
  </code></pre>