Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup - #define directive - how to use previously defined variable?

Tags:

inno-setup

I am using Inno Setup version 5.4.2.

I want to define the path for the files to copy (the Source: parameter in the [Files] section as two parts, a base path and sub-directory names, that I use for special files (like .dlls). I have tried the following:

#define MyAppSetupDir "D:\MyApp\setup" #define MyAppSetupQtDLLs {#MyAppSetupDir}"\DLLs" [Files] Source: {#MyAppSetupDir}\MyApp.exe; DestDir: {app}; Flags: ignoreversion Source: {#MyAppSetupDLLs}\mstext35.dll; DestDir: {app}; Flags: ignoreversion 

but I get the following compilation error

[ISPP] Expression expected but opening brace ("{") found. 

I also tried to enclose the braces in "", like

#define MyAppSetupQtDLLs "{#MyAppSetupDir}\DLLs" 

But this time I got

Error: Source file "D:\MyApp\setup\{#MyAppSetupDir}\DLLs\mstext35.dll" does not exist. 

So, ISSP is correctly replacing the MyAppSetupDir variable, but then puts again the simple text, as if it did not recognize the directive.

I have searched everywhere, and I already found a discussion about using the {commonappdata}, but I could not find how to do this, neither in the documentation nor in the KB. I would really appreciate some hints, as it looks I am close, but not finding the right solution..

like image 539
LittleFish Avatar asked Oct 29 '11 13:10

LittleFish


People also ask

What is Inno Setup used for?

Inno Setup is an open source script-driven installation system created in Delphi by Jordan Russell. The Inno Setup Extensions Knowledge Base (ISXKB) aims to support users of this installation system by providing a source of information, code snippets, guide lines, and ready-to-use solutions.

What language does Inno Setup use?

Inno Setup's [Code] section uses Pascal (or Pascal Script to be more exact, thanks to TLama), likely because Inno Setup itself is written in Pascal Delphi.

Does Inno Setup work on Linux?

You're in luck: It's possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.


1 Answers

#define MyAppSetupDir "D:\MyApp\setup" #define MyAppSetupQtDLLs MyAppSetupDir + "\DLLs" 
like image 102
Andreas Rejbrand Avatar answered Sep 21 '22 14:09

Andreas Rejbrand