I am using clickonce for deploying WPF application.
But when user installs using exe file which I published, it gets installed inside some random directory on user's machine.
Is there way to control path of directory where published application will get installed on user machine?
Thanks,
Pankaj
ClickOnce's purpose is to install the app into a sandboxed location in the user's profile.
If you need to control where your application is installed, you need to use a different packaging and installation mechanism like Microsoft VisualStudio 2015 Installer Projects or InstallShield LE.
Related
I've got an OSS WPF application and I want to ship a self-updating installer for it. I know that GitHub has this raw.github.com which serves just files so my question is, if I make a directory with a ClickOnce installer, will the ClickOnce self-update mechanism be able to pull updated files from GitHub?
I have an open source WPF application hosted on GitHub: https://github.com/tomhunter-gh/SourceLog
What I was hoping to do was add ClickOnce deployment and host the ClickOnce install on AppHarbor so that users are automatically upgraded when I push new commits to GitHub. What I'm looking for is an auto update feature similar to the GitHub Windows client, and I'm also hoping to find somewhere to host the ClickOnce install bits for free.
I have a number of questions:
How does AppHarbor actually work? As far as I can tell it expects a Visual Studio solution containing a single web application project, which it then builds and "deploys". What specifically does it look for to run, what assumptions is it making? What happens when you have non web projects, or your solution isn't in the root directory for example?
Is there any way to customise the build and deployment process, for example with custom MSBuild scripts?
How would I ensure the WPF project is "published" so that the ClickOnce bits are generated?
Is there any way to get a build number from the AppHarbor build process? E.g. a four part assembly version 1.2.3.4 and write that to the generated binaries/config?
Is there any way for AppHarbor to push the ClickOnce bits back to GitHub after a successful build, so that I could instead host the ClickOnce install on GitHub?
Should I be taking a completely different approach?
It turns out this is entirely possible and the steps are as follows:
AppHarbor
Ensure you are using a Web Worker process.
Add an application in AppHarbor and connect it to your GitHub project.
Solution
Add a web application project to the solution
Copy the v7.0A Windows SDK folder (C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A) to a folder alongside the solution
WPF Project
Set the DefaultTargets attribute of the Project element to Publish.
Set the PublishDir property to $(OutDir)\_PublishedWebsites\{ClickOnceHostWeb}
Set the UpdateUrl property to http://yourapp.apphb.com/.
Set the following additional properties:
<GenerateBootstrapperSdkPath>$(MSBuildProjectDirectory)\..\Lib\Microsoft SDKs\Windows\v7.0A\Bootstrapper</GenerateBootstrapperSdkPath>
<SdkToolsPath>$(MSBuildProjectDirectory)\..\Lib\Microsoft SDKs\Windows\v7.0A\Bin</SdkToolsPath>
Further details are available in my SourceLog blog post, and a full example is demonstrated by the the SourceLog project on GitHub.
I have developed a WPF application and I need to try it on other computers.
1- I change my project properties to build in release mode and rebuilt project. However, /bin/release folder is empty and it still generates /bin/debug folder.
2- I selected publish and install it on other computers. Funny thing is, the program is not running if that computer does not have Visual C# (.Net Framework, Sql server etc. does not cause a problem)
3- I added a installer and add project output(release) to this application. It says /bin/release/abc.exe couldn't be find.. Changed it to project output(debug) and it builds fine. However, this setup is not even working on my computer..
So my question is simple... How can I publish WPF application in release mode and how can I run them on other computers without installing Visual C#. Thank you in advance
Check properties of your project, and set output folder for Release configuration.
You need .NET 4 framework installed on PC, to run (simple) WPF application.
Should work, when you set your output folder, see 1.
MSDN does not list a WPF .exe as a supported type of application for ClickOnce
A ClickOnce application is any Windows Presentation Foundation
(.xbap), Windows Forms (.exe), console application (.exe), or Office
solution (.dll) published using ClickOnce technology.
http://msdn.microsoft.com/en-us/library/t71a733d.aspx
I do find evidence around the web that non-XBAP WPF apps work with ClickOnce, but are they officially supported?
Yes, ClickOnce does support WPF applications compiled to executables. ClickOnce is nothing more than an installation distribution method. The primary difference between creating an installation package and ClickOnce (other than being web-based) is that ClickOnce applications are installed within obfuscated folders within the end user's Windows directory.
The means that ClickOnce applications can be installed with a non-administrator account. The caveat to this method is that an application can not be installed on a PC and shared across other user accounts on the PC-- each user must re-install the application.
WPF requires the .NET 3.0+ framework. When you publish your ClickOnce application, you will need to include the .NET 3.0 (or 4.0) framework. Once you add the prerequisite to your project, ClickOnce will check the user's PC to see if the framework is installed. If not, it will pre-install it before installing and running your application. If it already exists, it will skip the download and installation of the framework.
If you need to install a third-party library or application, custom pre-requisites can be created and added to your projects. It is worth noting, prerequisites may need to be installed by an administrator, depending on the rights of the end user. This may seem a bit counter-intuitive, but it's just the nature of the installation process.
ClickOnce is a very simple, but robust installation mechanism, and I've used it extensively. It's not appropriate for every circumstance, but it can certainly accomplish what you are asking.
For ClickOnce, there is no difference between a Windows Forms executable and a WPF executable. Both are .NET executables and as such fully supported by ClickOnce...
I have personally deployed several WPF desktop applications using ClickOnce, and it worked exactly the same as with my Windows Forms applications...
Is it possible to install a WPF4 Net 4.0 application using a MSI Installer (Advanced Installer) and still leverage ClickOnce's application updates? I'm not talking XBAP but a full desktop app.
I'm asking this question because I've read conflicting statements on the web and here on SO.
Can you wrap that in an MSI and deploy it as a prerequisite to the ClickOnce application?
You can't install an application with an MSI and then use ClickOnce to update it -- it must be installed as a ClickOnce app to start with.
You might be able to zip up the ClickOnce deployment and then unzip it on the customer size and install it from the local folder. If the Installation URL in the manifest is correct, I think that will work. I can't advise further on that, since my expertise is only in ClickOnce deployment.