views:

293

answers:

2

Hi all, I have this trouble:

I am using VS 2008 Team Suite, and I have WinForms csproj. I want Publish it using ClickOnce.

In Publish Properties of csproj, I have these values:

Publishing Folder Location (web site, ftp server, or file path): C:\ClickOnce\Frk.Security.CarWin.WebInstall\Publicacion\

Installation Folder URL (if different than above): http://CHANGETHESERVER/carwinclickonce/Publicacion/

Publish Version: 1.0.0.0

Prerrequisites: Windows Installer 3.1, .NET 35. sp1

Now, I publish and all is OK. I need deploy my app to several machines (Development, Preproduction, production environments...), and I use Msbuild...

<Microsoft.Sdc.Tasks.Folder.CopyFolder
    Source="Publicacion"
    Destination="$(Directorio_Destination)\Publicacion" />

I copy C:\ClickOnce\Frk.Security.CarWin.WebInstall\Publicacion\ to another machine, in folder (this folder is root of a Web Site)

\\desiis\c$\Webs\carwinclickonce\Publicacion\ 

(http://desiis/carwinclickonce/Publicacion/)

I use MSBUILD and Mage like this; variable $(ProviderUrl) = http://desiis/carwinclickonce/Publicacion/

<Target Name="PublishClickOnce">
    <Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" />

    <Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx" />
  </Target>

Now, I have my publish.htm in http://desiis/carwinclickonce/Publicacion/publish.htm.

There are two links to install application: 1. ) http://desiis/Carwinclickonce/Publicacion/Frk.Security.CarWin.application

Everything is OK for this option.

  1. ) http://desiis/Carwinclickonce/Publicacion/Setup.exe

This option gets errors!

The errors are the following:

Error al intentar descargar 'http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application'. (FAILS when try download 'http....Frk.Security.CarWin.application')

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.

install.log contents:

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

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

Launching Application. URLDownloadToCacheFile failed with HRESULT '-2146697211' Error: Error al intentar descargar 'http://CHANGETHESERVER/carwinclickonce/Publicacion/Frk.Security.CarWin.application'. (FAILS when try download 'http....Frk.Security.CarWin.application')

Any ideas? Can I use Mage.exe commands? How can I modify setup.exe?

Update:

use msbuild for using setup -url=http://desiis/....

<Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)" />

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.

  1. How can use setup -url=http://.... in silent mode?
  2. How can I sign the setup.exe again?

My msbuild

<Target Name="PublishClickOnce">

<Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)" /> 
<Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" /> 
<Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx" /> 

</Target>
A: 

update:

Now, Publish and All is OK done. I need deploy my Publish in several machines (Development, Preproduction, production environments...), and I use Msbuild.

Then, using MSBUILD

 <Microsoft.Sdc.Tasks.Folder.CopyFolder Source="Publicacion" Destination="$(Directorio_Destination)\Publicacion" />

I copy C:\ClickOnce\Frk.Security.CarWin.WebInstall\Publicacion\ to another machine, in folder (this folder is root of a Web Site)

\desiis\c$\Webs\carwinclickonce\Publicacion\

(http://desiis/carwinclickonce/Publicacion/)

I use MSBUILD and Mage like this; variable $(ProviderUrl) = http://desiis/carwinclickonce/Publicacion/

<Target Name="PublishClickOnce">
    <Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" />

    <Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx" />
  </Target>
Edit your original question rather than adding a post. New posts are assumed to be answers to the question.
whatknott
A: 

To clarify, ClickOnce works. Your problem is with the setup.exe bootstrapper file that Visual Studio generates to install prerequisites. You use a bogus server name (CHANGETHESERVER) and change it later depending on what server you deploy to. The server name can easily be changed for the .application file but you're unsure how to fix the setup.exe file since it tries to launch http://CHANGETHESERVER/... after installs the prereqs. Is all this correct?

I'm not sure how to update your setup.exe file to point to the proper url. However, I wouldn't worry about updating it. I would go to Visual Studio, change "CHANGETHESERVER" to an actual server (like your Development server), and publish. The setup.exe that's generated will be good for the server you used. Keep a copy of that .exe and do the process again for your other servers (QA, Production, etc.). Deploy the server specific files to each server and you're done.

The setup.exe files aren't going to change unless you're adding/removing prerequisites. There's no need to generate and deploy a new one every time you deploy.

whatknott
It's correct. MrRobinDotnet says me: setup -url=<url to application file> --> changes the url it points to. I use msbuild for do it Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)". Another problem is that after using the /url switch to change out the URL, it appears message for manually confirming that the signature will be invalided for the assembly. More info, here http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/55b8986b-bbd1-41ae-801b-c9160498639e thanks !!!
Alhambra Eidos
Two issues: 1.how can use setup -url=http://.... in mode silent ?. I dont want that appears the message for confirming. 2. How can signature the setup.exe again ?? My msbuild is for Target Name="PublishClickOnce" 1. Exec Command="$(PublishDir)\setup -url=$(ProviderUrl)" 2. Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -pu $(ProviderUrl)" 3. Exec Command="$(Mage) -u $(PublishDir)\Frk.Security.CarWin.application -cf $(CertDir)\Frk.Security.CarWin_TemporaryKey.pfx"
Alhambra Eidos
I don't know how to use the "setup -url=" command. I'm saying you should just generate a setup.exe for each environment one time. The setup.exe doesn't change, so there's no need to keep creating and deploying it.
whatknott
I would like generate a setup.exe one time for all environments, NOT for each environment one time. Only I want use msbuild automation tasks for change the url in setup. Its a bug, https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=519149, but I think NO solution yet. Any more information about it ? Thanks.
Alhambra Eidos
the "setup -url=http://..." command works in vs2010.
whatknott

related questions