ClickOnce: Dependent Executable in manifest not installed - windows

I have a ClickOnce deployed application A that requires a third-Party executable B.exe. B.exe is referenced inside the Project A.
The application manifest contains A.exe as startup application. A.exe.manifest contains a dependency to B.exe.
All binaries and manifests and other required files are correctly deployed to IIS.
Upon executing the Application network-deployed for the first time, the Application is completely downloaded by ClickOnce. All required files appear in the ClickOnce Log File in this way:
[09:05:53] : Method Call : DownloadSingleFile called
[09:05:53] : DownloadQueueItem : _sourceUri = http://localhost/A/1.0.0.0/B.exe, _targetPath = C:\Users\Me\AppData\Local\Temp\Deployment\PT44L145.G7Y\6OXRRZ4O.RG4\B.exe
[09:05:53] : HttpWebRequest= Proxy.IsByPassed=True, ProxyUri=http://localhost/A/1.0.0.0/B.exe
[09:05:53] : HttpWebResponse=ResponseUri=http://localhost/A/1.0.0.0/B.exe
I don't know whether the file is correctly copied to _targetPath because the folder is deleted too fast.
The file is copied correctly to _targetPath.
After deploying A.exe is executed by ClickOnce from the Installation directory (something like C:\Users\Me\AppData\Local\Apps\2.0\RZPET3XL.MDD\DP0VG7XH.MDZ\A.exe_f5309fcb4f74cdd0_0004.0003_07a7ad3d606fa838\)
The directory C:\Users\Me\AppData\Local\Apps\2.0\RZPET3XL.MDD\DP0VG7XH.MDZ\A.exe_f5309fcb4f74cdd0_0004.0003_07a7ad3d606fa838\ does not contain B.exe so the Third party process cannot be started. But it contains B.exe.manifest, B.exe.config, B.cdf-ms and all other files required by the application and contained in A.exe.manifest.
Why is B.exe not copied to the installation directory and how can i let it appear there?
// edit: I used Process Monitor and checked whether there was maybe a problem with opening the file or something other weird. There was none. There is not even an attempt to read B.exe from the deployment directory.

Related

How to install ClickOnce application without a local manifest

I have a ClickOnce application sitting on my company's file server, including the setup.exe and the .application manifest. Due to network settings, users that wish to install my application must copy the setup.exe to their local machine. Unfortunately, the installation fails if it can't find the manifest. We can get around this by copying the manifest to the local machine alongside the setup.exe. The manifest has the "deployment location" set as the file server, so the copied local manifest is never used; it's only purpose is to placate the installer.
Is there a way to tell the installer to look for the application manifest at the specific file server location, and not look for it in the same folder as the setup.exe?

ClickOnce : deploy files to different location

Using ClickOnce, is it possible to include a file (resource, dll, image, whatever) to be copied to a different location and NOT the app folder?
What I am trying to achieve exactly is to install Microsoft.Web.Publishing.Tasks.dll + Microsoft.Web.XmlTransform.dll and their .targets to C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web so those msbuild tasks can be used on workstations that do not have Visual Studio installed.
It was so easy using a Setup Project before VS 2013!!
I repeat: I do NOT want those files to be installed in the app folder (so please don't tell me to set the option Copy to Output = Always" on project files).
Thanks.
No. You can't do it with ClickOnce.
Either deploy the files and write code to copy files when your app starts. Or use some other deployment option, like msi.

Add shared library project's dll file to executable projects path at runtime in Eclipse

I'm using Eclipse Juno for c/c++ under Windows 7. I've created a shared library project and an executable project. I've added the shared library project as a reference in the executable project via:
executable project's properties -> C/C++ General -> Path and Symbols -> References -> check the shared library project
All this works great at compile time, I can include my shared library project's class in the executable project, and use it etc.
However when I try to run the executable project in Eclipse, I get nothing. No error, no console output. After some googling I've discovered a similar issue here:
http://www.eclipse.org/forums/index.php/m/650331/
Apparently adding the shared library project to the executable project in Eclipse, as described above, does NOT also add the dll file to the executable (.exe) file's PATH at run time inside Eclipse. As an analogy with Eclipse for Java: if you have a Java JAR project A and another Java JAR project B, by making a reference from B to A in Eclipse, B's compiled jar file IS added to A's class path when running project A inside Eclipse. I thought it would be similar with Eclipse for C/C++ but apparently it's not.
Sure enough, if I manually take the .exe file and the .dll file, place them in the same folder and run the .exe, everything works ok. Also if I copy the .dll file in to Eclipse's compilation directory for the executable project, I can run the executable project from Eclipse and it's ok.
My question is then, is there a way to have Eclipse add that shared library project's dll file to the run time when I'm telling it to run the executable project? The discussed solution in the post I link to above is to manually add the shard library project's compile directory to the Eclipse's run configuration for the executable project, namely, to add it to the PATH variable there. But I find this cumbersome and not portable, if Eclipse is managing both projects it should be able to pass all that's necessary to the run time.
Well, I've went with the manual adding of the library project's dll to the excutable project's path at run time. I did find a way to make it more portable and project location neutral (i.e. if you move both projects' source folders to another machine, and reopen them in Eclipse there, it should still work):
right click on executable project -> Run as... -> Run Configurations
in the Environment tab click "New..." to add a new environmental variable
Name your variable "PATH" and give it a value similar to this:
${env_var:PATH};${workspace_loc:/cppAStar/Debug}
where:
${env_var:PATH} is Eclipse's way of saying "get the already existing value of the PATH environmental variable as declared in Eclipse"
the ";" is to separate the exisitng PATH entries from the new one we're about to add
${workspace_loc:/cppAStar/Debug} this tells Eclipse to get the location of the workspace project named cppAStar (here cppAStar is my shared library project) and then the "/Debug" refers to where this particular project creates the .dll file when it's built.
Issues that I couldn't figure out:
the "Environment" tab in "Run configuration" has an option called "Append environment to native environment". I thought that by checking this I'd only need to add the location of the .dll dir in the PATH variable I declare here, and it will be appended to the existing PATH. However I've not managed to make this work, hence the manual re-adding of all the existing PATH before appending the new value
Unfortunately that solution does not work for the debugg configuration. See Bug 338420 -Launch configuration's Environment tab variables are not passed to the gdb process itself.
Is there a way to solve this problem for debugging? I mean except from doing post-build steps like:
cmd /c copy "${BuildArtifactFilePrefix}${BuildArtifactFileName}" "${WorkspaceDirPath}\bin\"

TFS build - deployment/package target does not run

We have a TFS build definition set up where we pass the following extra MSBuild arguments in:
/p:DeployOnBuild=true;DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder;_PackageTempDir="\\server\build";AutoParameterizationWebConfigConnectionStrings=false
This has been detailed elsewhere as a way to have the published files copied to a specific location instead of generating a deploy package.
This unfortunately does not work on our build server, however if I run the exact same msbuild command line as called by TFS on my dev machine then it works perfectly and copies the output files to the location.
I have checked the log file and there is no errors, it just seems to completely skip the publish/deploy step.
Done building target "_BuiltWebOutputGroupOutput" in project "xyz.csproj".
Target "PrepareForRun" in file "c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets" from project "C:\Builds\2\xyz\xyz build\Sources\xyz.Web\xyz.Web.csproj" (target "CoreBuild" depends on it):
whereas on my local machine, after _BuiltWebOutputGroupOutput target is run the package target runs and deploys the files correctly.
I have tried using different paths and even setting the properties in the project file but it seems to make no difference. My local solution and project files are the same as in the repository that the TFS build is using. Is there something config related on our build server or with the build agent that would cause the packaging target not to run?
I was having a similar problem today and found a fix so it maybe worth a look for you. Here

Visual Studio problem with deploying all files of .NET Compact Framework application

My application consist of an executable project and a dll library. My executable project has added the reference to the library project.
The library project contains some "content" files like .ini .bmp. The problem is that these files are not copied to the device when I deploy the executable project. Only dll file is copied. The curious thing is that all files are copied to the \ExecutableProject\bin\Debug directory on the desktop machine.
To workaround this I've set the deployment path of dll project the same as executable project and I'm deploying them both, but this solution doesn't seem to be nice.
I'm using VS2008 and my device works on Windows CE.
There are a few things to check.
Double check that the "Build Action" is set to "Content"
Make sure that the "Copy to Output folder" is set to "Copy Always" or "Copy If Newer"
Make sure that the deployment folder for the library project is what you expect (Properties->Devices->Output File Folder)
Make sure that the library project is set to the same target device as the executable
Make sure the library project is set to deploy for your configuration (Build->Configuration Manager)
Remember that if the content files are in a subfolder in the project, they will end up in a subfolder on the device

Resources