Giter Club home page Giter Club logo

autoincrement-vc-dll-exe-version's Introduction

Easy Pre-Build Automatic increment Version number in Visual Studio C++ project (DLL/EXE)

It is important to increment the version number of a DLL because upon installation the DLL will in most of the cases not be installed/updated if the version number is not incremented. There is no immediate solution for this in MS Visual Studio and you must edit the resource file every time before your build the project. If you forget to do this then your software will not function properly after the new version is installed. This repository contains an example project with a PowerShell scrip solution to this problem. A pre-build event and the PowerShell script will auto-increment the version number every time you build the project. The script will work in Windows 7, 8 and 10. In Windows 7 and 8 you may have to update your PowerShell version.

Follow the next steps to add an automatic pre-build version increment to your DLL or EXE C++ project:

  1. Add a version resource.

  2. Add the following files (included in the repository) to your project's root folder: FindAndReplace.ps1, version.ps1 and version_define.ps1

  3. Edit the version_define.ps1 file and change the version number to the minor current version of your DLL or EXE. The minor version number is the second number, e.g. in v.1.2.3.4 the number '2'. Do not add extra spaces or characters on the version line!

  4. Add a pre-build event to your VS project (Release and any other configuration) with the following script (see the example project in the repository):

powershell.exe -ExecutionPolicy Bypass -File $(ProjectDir)version.ps1 $(ProjectDir)AutoincrementVersion.rc $(ProjectDir)version_define.ps1 $(ProjectDir)FindAndReplace.ps1

  1. In the above script change the file name 'AutoincrementVersion.rc' to your resource file name.

  2. If you recompile your project the minor version number will be incremented. There will also be a dialog box reminding you that the resource (and version_define.ps1) file is changed and must be reloaded.

Possible Improvements:

  • You may easily add the auto-increment of e.g. the major version.

Easy Pre-Build Automatic increment Version number in Visual Studio C++ project (DLL/EXE).

AI-TOOLKIT: https://ai-toolkit.blogspot.be

autoincrement-vc-dll-exe-version's People

Contributors

ai-toolkit avatar

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.