Is it possible to automate the creation of a inno setup package with ant?

后端 未结 2 1158
滥情空心
滥情空心 2021-02-03 15:57

I am creating an Eclipse RCP application.

I am following Joel\'s advice in the following article \"Daily Builds are your friend\":

http://www.joelonsoftware.com/

2条回答
  •  爱一瞬间的悲伤
    2021-02-03 16:59

    Another nice trick when automating installer building is to use the GetFileVersion preprocessor (ISPP) macro. That way you won't have to duplicate your (binary) files' version numbers in hardcoded form (like in Tom's settings.txt) - the installer compiler will simply read it from the files' version resources that way. 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
    

    Furthermore, you can forward symbols to the compiler via the /d commandline switch, e.g.:

    iscc.exe /dSpecialEdition ...
    

    and then later use these in ifdefs to create different types of installer (stupid example follows):

    [Registry]
    #ifdef SpecialEdition
    Root: HKLM; Subkey: Software\MyCompany\MyApp; ValueName: SpecialEdition; ValueType: dword; ValueData: 1 ...
    #endif
    

提交回复
热议问题