Deploying ClickOnce via Mage and Visual Studio Publish Wizard - winforms

We identified that when you deploy your clickonce project via MageUI.exe, the Setup.exe or Publish.htm does not being created.
Is there anyway I could create the Setup.exe with pre-requisites included at least? We could figure a way to create a HTML page. However if there is a way to create a complete deployment package way similar to Visual Studio's wizard that would be ideal.
Thanks & Regards,

This may not work for you, but instead of compiling the code and then calling mage to create the click once, you'll need to do this using msbuild.
Using MSBUILD, there's a publish target you can call to get this working.
E.x.: msbuild WindowsFormsApplication5.sln /t:publish

Related

CI/CD WPF setup file using Azure Pipelines

I have successfully created a Repo on Azure Devops and a Pipeline which triggers a release every time I push to the master branch. The result of the release is an .exe file that I can download from the Artifacts explorer. If I download the release and open it, the WPF app simply runs (no install required). I'm trying to wrap my head around how this whole CI/CD process would work but I just cannot find any good examples that could help me understand the deployment process(at least for WPF apps).
What I would usually do is build a WPF App, once I'm done, I add a new project to the solution (Visual Studio Installer - Setup Project) and deliver the .msi installer to the end user (for updates I send them the latest version to install).
How can I make this process a lot more smoother using CI/CD in Azure Devops? How do I generate an actual installer? Do I use some logic in the app itself to check for the latest build in Azure? Can someone please lay out some simple steps or some good resources?
You should be able to use a task like this: https://marketplace.visualstudio.com/items?itemName=dutchworkz.BuildInstaller to use the VS Installer project you have traditionally used.
This task wraps the calls to devenv that are needed to drive VS Installer to create its MSI package as it doesn't use the usual MSBuild engine to do this.
Other tools do a similar job, for example you could drive WIX or a similar tool to create the MSI package however if you are familiar with VS Installer Projects you may want to stick to this.

I am getting "myApp stopped working" after installig my WPF(+telerik) application

I created a WPF application using telerik control suite (WPF telerik controls and ORM access control) and SQL Express R2 2008 in VS 2012.
Then I created its setup files (using install shield LE and also Advanced Installer) which works on my win7 system, properly () .but when I install the setup file on any other win7 system, it doesn’t work( I am getting this error: “MyAPP has stopped working”).
I installed .NET framework and SQL Express R2 2008(the service’s status is running) and I also copied the mdf and ldf files related to the database in right path that specified in app.xaml.
When I install my setup files, it just copy my project’s debug folder (contains the telerik control dll files, the dll file related to my ORM access control project, built exe file and etc.). I think that’s enough. Isn’t it?
Edit:
The project's Solution's Explorer:
\bin\Debug
I have no idea what to do.
I would really really appreciate any hint or comment.
Regards,
Hiva
I know this is a very general answer although without knowing the details of your project it's the best I can do. I remember when I was creating an app using telerik controls, when I went to publish it I was getting errors in the with the assembly which was a result of including the obj / Debug / Release folders in my project. I tried everything that people listed to get rid of the errors but the only thing that helped was creating a new project, copying in the code and NEVER including(Never right clicking and hitting include in project) those folders in my project.
Is it working when you debug it?
Could you please let me know what steps you are taking to publish the app ?

Issue with PackageRestore, Silverlight, and MSBuild

We use NugetPowerTools PackageRestore to avoid putting our packages folder in svn. This works building .NET projects with Visual Studio and MSBuild. It also works building Silverlight projects with Visual Studio.
However, when we use MSBuild to build Silverlight projects, the build fails. This appears to have to do with the tasks in Microsoft.Silverlight.Common.targets. Looking at the MSBuild output, it appears to get to the step GetXapOutputFile before it errors. Something either in that step, or after that step, is looking for the packages, but the package restore does not run until after all of this. Building a second time will succeed.
What is different from pressing build in Visual Studio than running MSBuild? Is there a command line switch I am missing?
If that won't work, is there some way I can change the NuGet.targets created by NuGetPowerTools or something I can put in my csproj file that will switch the order these steps are run?
I am running MSBuild Solution.sln /target:Clean;Rebuild
Edit
I've update NuGet to v1.6, removed all traces of NuGetPowerTools and I am now using the built in Package Restore option. I am still getting this error.
Edit Again
A discussion around this issue has come up again. I've tested this now with NuGet v2.0 and it is still happening.
This has been corrected in NuGet v2.1.31002.9028. The details can be found in this commit.
For existing solutions, you will need to delete ./nuget/NuGet.targets from your solution. Do this through Windows Explorer. Deleting it through Visual Studio will only remove the file from your solution, it will leave the file alone.
Once you have done this, right click on your solution and select "Enable Package Restore". This will recreate NuGet.targets with the fix.

Including winforms installer in UppercuT code_drop

Does anyone know how to specifically include a winforms setup project to be included in the code_drop folder generated when running UppercuTs zip.bat? With the default settings my web applications and WCF services are included, as are the dll's for the solutions core, but not my winforms application/installer
I was just playing around with UppercuT last night, and I ran into the same question.
One tip I found for putting console apps and windows services into the code_drop is to use this Nuget package in your console/windows service projects:
http://nuget.org/packages/publishedapplications
See this for more info:
http://devlicio.us/blogs/rob_reynolds/archive/2011/03/22/published-applications-aka-publishedapplications.aspx
Using this will cause your console/windows service projects to be "published" similary to how a web app is published in the code_drop. However, this isn't what you're asking for, just wanted to point it out if its useful. This also doesn't work for installers.
If your installers are using the default Visual Studio setup projects (.vdproj projects), I haven't tried that, so I can't help there. I do know that MSBuild refuses to build those types of projects (not sure why...), so you might be better off using WiX or another installer technology. You can do an automated build on a vdproj if you run the build by calling devenv.exe directly from the command line, but you can't build those with MSBuild. I did try adding a WiX setup project to my sln, and UppercuT will build the Wix setup project and drop the .msi in the "build_output" folder, but it doesn't copy it over to the code_drop. My thought would be to add a custom post build step to just copy that file over from build_output to code_drop. I haven't had a chance to figure out the logic in the build scripts to see how it chooses which files to copy from build_output to code_drop. If I figure anything out, I'll update this answer.

How to Deploy WPF application using MSI

I have a WPF C# desktop application that will need to be deployed as MSI (Windows Installer deployment, not ClickOnce deployment) in VS2010. My application will generate SQL CE database in run-time, manipulate Excel Workbook, and receive/transmit data from/to COM Port - so I don't know what is the appropriate way to deploy such an application.
I am looking at Windows Installer Deployment Tasks which doesn't help me to get started.
Could anyone show me some resources that give instructions on how to deploy an application as an MSI installer?
If you don't want ClickOnce, then you'll probably need to create your own MSI. In that case, you can use:
The built-in Setup project type in Visual Studio. It does a decent job but has limitations. Works very well if you don't have many dependencies or custom actions.
A commercial tool like InstallShield
WIX (Windows Installer XML)
I've tried both 1 and 3. While WIX has a little bit of a learning curve, it is a very rich way to do what you want to do. There is a fair bit of documentation available and some very nice "out of the box" wizard sequences to handle your standard install scenarios (licenses, feature selection, dependencies, etc). WIX does have some VS integration that works quite well.
You can find out more on WIX at http://wix.sourceforge.net/
Note:
The VS setup project can do custom actions, and install dependencies, but you have to use custom actions. If you want to parameterize the custom actions, then you'll need to find the not-so-intuitive instructions on that topic.
The other limitation of the VS setup project is that the setup project can only be compiled to an MSI by VS (devenv.exe). That means that the MSI cannot be compiled on a build server unless you install Visual Studio there too. This was a show stopper for me, so I switched to WIX and was very happy with the result.
For those like me who found this post after searching high and low for how to deploy an MSI these days, you now need an extension as the visual studio team removed the built in startup project functionality. You now need to download the Visual Studio Installer Projects extension.
See this user voice post for discussion of the removal, and here is a link to the extension.
Useful for people looking for a quick solution to generating an MSI through Visual Studio rather than getting deep into Wix (although if you need more advanced deployment options, definitely go that route).
Configure your WPF application to publish as a ClickOnce application. You can do that in the 'Publish' tab of the project properties.
If you use the 'Publish Wizard' (by clicking on the aptly named button on the properties page) you can specify (on the second page) that the user will install 'From a CD-ROM or DVD-ROM'. This option will produce a setup.exe file in the publish sub-folder of your project output directory. This setup.exe program when launched by your user will install the WPF application. You may choose to include an update functionality (but you don't have to).
The ClickOnce settings also allow you to include additional files (e.g., your SQL CE database file) and pre-requisites if necessary.

Resources