Git Product home page Git Product logo

set-projectfilesclickonceversion's Introduction

Description

This PowerShell script can be used to update a project file's (.csproj or .vbproj file) ClickOnce version, and to set the Minimum Required Version to the lastest version.

This script is useful when publishing your ClickOnce application as part of your build and release system, since normally Visual Studio would automatically handle updating the ClickOnce version for you.

Setting the MinimumRequiredVersion property forces the ClickOnce application to update automatically without prompting the user. If you are simply looking to have the Minimum Required Version update automatically, but still publish your ClickOnce application from Visual Studio, try using the AutoUpdateProjectsMinimumRequiredClickOnceVersion NuGet Package.

Script Parameters

  • ProjectFilePath (required) - Path of the .csproj and .vbproj file to process.

  • Version - The Version to update the ClickOnce version number to. This version must be of the format Major.Minor.Build or Major.Minor.Build.Revision. The Build and Revision parts will be overridden by the BuildSystemsBuildId parameter, if it is provided. The Revision parts will be overriden by the IncrementProjectFilesRevision parameter, if it is provided.

  • BuildSystemsBuildId - The build system's unique and auto-incrementing Build ID. This will be used to generate the Build and Revision parts of the new Version number. This will override the Build and Revision specified in the Version parameter, if it was provided. This parameter cannot be used with the IncrementProjectFilesRevision parameter.

  • IncrementProjectFilesRevision - If this switch is provided, the Revision from the project file will be incremented and used in the new ClickOnce Version. This will override the Revision specified in the Version parameter, if it was provided. This parameter cannot be used with the BuildSystemsBuildId parameter.

  • UpdateMinimumRequiredVersionToCurrentVersion - If this switch is provided, the ClickOnce MinimumRequiredVersion will be updated to match the new Version. Setting the MinimumRequiredVersion property forces the ClickOnce application to update automatically without prompting the user.

  • PublishUrl - If this switch is provided, the ClickOnce PublishUrl will be updated. The publish url format is \\fileshare\foldername

  • InstallUrl - If this switch is provided, the ClickOnce InstallUrl will be updated. The install url format is http://fileshare/foldername

Examples

Update a project file's ClickOnce version to the specified version.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -Version '1.2.3.4'

Update the Build and Revision parts of a project file's ClickOnce version, based on a unique, auto-incrementing integer, such as a build system's Build ID.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -BuildSystemsBuildId 123456

Increment the Revision of a project file's ClickOnce version.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -IncrementProjectFilesRevision

Update a project file's ClickOnce Minimum Required Version to match its current version.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -UpdateMinimumRequiredVersionToCurrentVersion

Update a project file's ClickOnce version, ignoring the Revision part and incrementing the Revision stored in the file, and update the Minimum Required Version to be this new version.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -Version '1.2.3' -IncrementProjectFilesRevision -UpdateMinimumRequiredVersionToCurrentVersion

Update a project file's ClickOnce version and its install and publish url values.

& .\Set-ProjectFilesClickOnceVersion.ps1 -ProjectFilePath "C:\SomeProject.csproj" -Version 1.0.1.9 -PublishUrl "\\fileshare\foldername" -InstallUrl "http://fileshare/foldername"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.