Is it possible to automate the creation of an installation package using ant?

I am creating an RCP Eclipse application.

I follow Joel’s advice in the following article: "Daily Builds - Your Friend":

http://www.joelonsoftware.com/articles/fog0000000023.html

So, I wrote a good script construct that creates the RCL Eclipse product and runs unit code tests. All results are then distributed to the list of developers (after some grunts). Now, my next step, I want to create an installation package, which I usually create manually using the inno setup compiler.

The question is, how can I get around creating this package automatically? I think I can automatically create the inno configuration file from ant and then call the compiler from the command line, but I don't know if this is possible.

Any tips for this task? Maybe any other configuration application that can be used from ant?

+3
source share
2 answers

I'm sure his simple Inno project is a simple text file, so you can easily edit the setupper script with ant, however, I would recommend creating a separate small include file using the script. You can store "variables" there, such as the version number + assembly, which you show at the beginning of the setup.

put this line in your setupper:

#include "settings.txt"

and make settings.txt have something like this

#define myver=xxx.xxx
#define tags

now you don’t need to touch the actual setup code from the build script.

below is a snippet from my build script to compile setupper. you need to execute the batch file from ant as follows:

<exec dir="." executable="cmd" os="Windows NT">
  <arg line="/c build.bat"/>
</exec>

sample batch build.bat:

set isxpath="c:\program files\inno setup 5"
set isx=%isxpath%\iscc.exe
set iwz=myproj.iss
if not exist %isx% set errormsg=%isx% not found && goto errorhandler
%isx% "%iwz%" /O"%buildpath%" /F"MySetupper.exe" >>%logfile%
goto :eof
+7

- GetFileVersion (ISPP). (, Tom settings.txt) - . :.

#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

, /d, :

iscc.exe /dSpecialEdition ...

ifdef ( ):

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

Source: https://habr.com/ru/post/1697974/


All Articles