I maintain a Winform app deployed to the desktop via ClickOnce. Currently I use Visual Studio Publish wizard to make a new version available. I would like to automate this step, ideally via an MSBuild script. Is this possible?
When you invoke msbuild /target:publish at the command line, it tells the MSBuild system to build the project and create a ClickOnce application in the publish folder. This is equivalent to selecting the Publish command in the IDE.
This comes from the MSDN documentation for MSBuild
http://msdn.microsoft.com/en-us/library/ms165431.aspx
Related
I am using Visual Studio 2017 for a winform application. There is a publish option when I right click on the UI project.
The publish wizard asks for the following information:
Where do you want to publish the application (Location to publish): \\servername\foldername
How will users install the application?: From a UNC path or file share. \\servername\foldername
Will the application be available offline?: No
I am trying to automate this using Jenkins. Is there anyway to run this using MSBuild / MSDeploy? I am looking for command line arguments I need to provide for the above options.
From Prerequisites on the setup property pages, I selected the option to Download prerequisites from the component vendor's web site
There is no Windows Installer 4.5 in the prerequisites to install option..
because every im installing my setup using the sqlexpr_x64_ENU.exe in custom actions to install, run the setup after the extracting sqlserver it pops up the window says
There is a problem with this Windows Installer package. Aprogram run as part of the setup did not finnish as expected. Contact your support personnel or package vendor
im using VS2017 on windows 10
Exclude MSI Engine: You should not include Windows Installer 4.5 with any package these days. This runtime is from back in the day of Windows Vista - we are long since on version 5. Windows Installer should be deployed only via Windows Update as of today - in my opinion. Leave the runtime out of your setup.
No Concurrency: You can not run an MSI setup from within another MSI setup via a custom action. This is due to technical restrictions. There is a mutex set when an MSI runs its actual installation sequence, and triggering another installation sequence from within it will fail. A similar answer on the topic.
Setup.exe Launcher: What you need is to install your pre-requisites via a setup.exe launcher instead. This runs installations in serial, not in parallel. Which version of SQL Server are you installing? I see only a couple of versions available in the Visual Studio Installer Project launcher.
Other tools have features to allow you to install a setup.exe with embedded packages of various kinds in sequence. I have explained a myriad of times how to do this in previous answers. Here are just a few that I found quickly:
SQL Server named instance with Visual Studio 2017 Installer project (basically exactly the same issue - I suggest WiX the open source, free alternative)
Custom installer for application in Visual Studio 2017 (I suggest WiX and several commercial tools that are easier to use - maybe try to read this one)
Cannot call command.exe(SQL Server Setup.exe) while calling C# CA with parameters
How to create a MSI file which simply copies a directory to Program Files? (tools list)
Combine exe and msi file in one installer
Visual Studio 2017 Installer Project - include VC++ 2015 Redistributable
The general situation:
The problem is not Windows Installer 4.5, it's the fact that you are trying to do a recursive MSI install (the SQL one from inside yours) which is not allowed and will fail.
The MSI 4.5 engine is pretty much obsolete, about 10 years old, and anyway it's not the issue, and it's not clear why you believe it is. But it IS in the Prerequisite list on my VS 2017 setup project prerequisites - see 3 - even though you almost certainly don't need it.
There are some SQL Express options available in the Prerequisites of the VS setup project - right click the project in solution explorer and choose Properties, then Prerequisites.
How can I create set up file for WPF application ? I'm new to WPF applications and I don't have any idea about initializing this.Please help me !!
I advise you to use InnoSetup. It's a powerfull tools to make setup-wizard for all projects. You can create it easyly. And more features are available with it (icons file, registry management, associate file extension with application, desktop and start menu windows entry, and much more...)
I suggest you to go through below link if you are using VS 2010 and above-
CREATE SETUP AND DEPLOYMENT OF WPF APPLICATION STEP BY STEP WITH VISUAL STUDIO 2012
You need InstallShield packaging software to after Visual Studio 2008.
It will create a template to create deployment project, but you can
get the Visual Studio Installer Projects in VS 2010 and above , you
need to install the Visual Studio Installer Extension from the Visual
Studio Extension Gallery - Microsoft Visual Studio Installer
Projects
If you are using VS 2008 then it already have template to create setup project your WPF application. Just follow the below link to know that How use Setup Project..
Create Setup and Deployment of WPF Application Step by Step
#Hana's answer showing screenshot of the Setup Project, which is used in the VS 2008 to create the deployment package.
References:
Create an application setup in visual studio 2013
Visual Studio 2013 Installer Projects – Hello World Installer
Using VS 2008:
Add a Setup and Deployment project to the Solution
As soon as you add the project it opens the File Explorer view.
add Program File's Folder to our Setup project
add Primary output and other dependencies to Application Folder.
Select as displayed above.
Now we would add A folder to the Program Files Folder.
Now add the same as you did for the Application Folder.
add a Shortcut to User's Desktop.
Rebuild the Solution and then rebuild the Setup project.
Full help is here
I have created a win forms application that is installed using a setup and deployment project. During a recent update to the setup and deployment project, I've caused a problem that I can not find the source of. Each time I click on the shortcut to my project, it runs the setup again. In effect it is repairing the install each time the shortcut is clicked.
Also, this issue is related to the shortcut that is created by the setup and deployment project. If I go directly to the console.exe file and run my application it does not attempt to repair it.
Using visual studio 2008 and I have custom actions that run on the install, however I can't see how they could cause the application to repair itself on load.
Thanks
In Visual Studio 2010 there is a nice feature of the database project that allows you to deploy to a database as well as set up various environments based on your configuration (Build deploy etc)
I Would like to integrate this into our automated build environment.
Firstly by having the deploy script run after a successful build on my local machine. (So I can go straight into running the unit tests)
Then by Having the deploy script run after the successful build on our build server. so that any schema changes required for the unit and integration tests will run.
How can I adjust the MSBuild or similar to run these in deploy mode.
Use the MSBuild task to call the "dbproj" file. Pass "DBDeploy" as the target and the build configuration as a property, e.g.:
<MSBuild Projects="MyDb.dbproj"
Targets="DBDeploy"
Properties="Configuration=$(Configuration)" />
On a build server, you might also need to supply properties like TargetConnectionString and TargetDatabase.