开发者

How to create a ClickOnce installer that runs silently and requires no user interaction?

开发者 https://www.devze.com 2023-04-04 11:35 出处:网络
Ideally no window would pop up at all when setup.exe is invoked, but it would be nice to save the user from having to clic开发者_StackOverflowk \"OK\" on installing pre-requisites and other options. I

Ideally no window would pop up at all when setup.exe is invoked, but it would be nice to save the user from having to clic开发者_StackOverflowk "OK" on installing pre-requisites and other options. Is that even possible with ClickOnce?


Additional Files

Additional components (files and DLL files) can be added automatically as part of the download in the property pages of your project 'Publish' > 'Application Files...'.

Prerequisties

As for prerequisties, this will require the users permission (unless you code this to perform a silent install when your application starts - not recommended and nasty solution). At work I got Infrastructure to roll out prerequisites such as .NET 3.5/4.0.

Silent ClickOnce install

To create a silent ClickOnce installer, set the MinimumRequiredVersion element in your WPF/Windows Forms project file to same version as ApplicationVersion.

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
...
<MinimumRequiredVersion>1.0.22.1</MinimumRequiredVersion>
<ApplicationVersion>1.0.22.1</ApplicationVersion>
...
</PropertyGroup>

If these version numbers are the same, the user will not be prompted with a dialog to update.

At work, I have automated this using a custom build number from TFS to set the version MinimumRequiredVersion and ApplicationVersion in the project file.

0

精彩评论

暂无评论...
验证码 换一张
取 消