Automated-build version number with WiX, Inno Setup, and VS2008

后端 未结 5 1025
-上瘾入骨i
-上瘾入骨i 2020-12-13 11:03

Basically what I need is an automated way to update the product version number in WiX (3.0 with Votive etc), and then get that version number into an Inno Setup \"bootstrapp

5条回答
  •  隐瞒了意图╮
    2020-12-13 11:15

    No need to pass anything! You can simply let the InnoSetup Preprocessor read the version info straight from the binary's version resource, e.g.:

    #define AppName "My App"
    #define SrcApp "MyApp.exe"
    #define FileVerStr GetFileVersion(SrcApp)
    #define StripBuild(str VerStr) Copy(VerStr, 1, RPos(".", VerStr)-1)
    #define AppVerStr StripBuild(FileVerStr)
    
    [Setup]
    AppName={#AppName}
    AppVersion={#AppVerStr}
    AppVerName={#AppName} {#AppVerStr}
    UninstallDisplayName={#AppName} {#AppVerStr}
    VersionInfoVersion={#FileVerStr}
    VersionInfoTextVersion={#AppVerStr}
    OutputBaseFilename=MyApp-{#FileVerStr}-setup
    

    Before version 5.4.1 (2011-02-09) ISPP was not included in the default InnoSetup package. You had to download the InnoSetup Quick Start Pack: http://www.jrsoftware.org/isdl.php#qsp (thanks @Gwyn, for the update)

提交回复
热议问题