0
votes

I have an InnoSetup script I have been using for years, and suddenly it stopped working, specifically on this line in the [Setup] section:

WizardImageFile={src}\..\..\images\InstallBanner.bmp

The error reported is:

Compiler Error!
Line 47: Could not read "C:\projects\xxxx\installer\{src}\..\..\images\installbanner.bmp".
Error: The system cannot find the path specified.

Two potential problems I noticed, {src} is still in the file path reported, and the file name is all lowercase. Except for these two issues, the file name is correct, and the file exists.

Am I using the {src} constant incorrectly and this has previously worked by coincidence, or is this a bug that was introduced with an update?

Currently running 6.0.2. I know 6.0.4 is released, but cannot currently install it, and didn't notice an issue like this mentioned in the revision history.

2

2 Answers

0
votes

You cannot use constants in WizardImageFile. It makes no sense. The constants are evaluated on runtime. While WizardImageFile is read on compile time. Also {src} refers to the path, from where an installation was started. How would it evaluate, when you are only building the installer?

If it ever worked, you must have subfolder with literal name {src} somewhere on the path, where you were compiling the installer.

0
votes

As @MartinPrikryl said, {src} and other constants cannot be used as they are evaluated at runtime. Definitions may be used, and the {#SourcePath} definition works as a starting path relative to the script location

WizardImageFile={#SourcePath}\..\..\images\InstallBanner.bmp