Search code examples
inno-setupappveyor

Inno Setup can't find image files using mask on AppVeyor


We have a OSS project and I'm trying to upgrade to Inno Setup 6.0.5. When I compile the build script locally, it works as expected. However, when I try to build it via AppVeyor, it can't find the files. I've tried both:

  1. using full path (this was working with 5.6.1):

    #define BuildDir ExtractFileDir(ExtractFileDir(SourcePath)) + "\bin\"
    #define IncludesDir SourcePath + "Includes\"
    #define GraphicsDir SourcePath + "Graphics\"
    
    ...
    
    WizardSmallImageFile={#GraphicsDir}Rubberduck.Duck.Small.55x55.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.64x68.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.83x80.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.92x97.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.110x106.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.119x123.bmp, \
                         {#GraphicsDir}Rubberduck.Duck.Small.138x140.bmp
    
    WizardImageFile={#GraphicsDir}Rubberduck.Duck.164x314.bmp, \
                    {#GraphicsDir}Rubberduck.Duck.192x386.bmp, \
                    {#GraphicsDir}Rubberduck.Duck.246x459.bmp, \
                    {#GraphicsDir}Rubberduck.Duck.273x556.bmp, \
                    {#GraphicsDir}Rubberduck.Duck.328x604.bmp, \
                    {#GraphicsDir}Rubberduck.Duck.355x700.bmp
    
  2. using wildcards:

    #define BuildDir ExtractFileDir(ExtractFileDir(SourcePath)) + "\bin\"
    #define IncludesDir SourcePath + "Includes\"
    #define GraphicsDir SourcePath + "Graphics\"
    #define WizardImageFilesDir GraphicsDir + "WizardImageFiles\"
    #define WizardSmallImageFilesDir GraphicsDir + "WizardSmallImageFiles\"
    
    ...
    
    WizardSmallImageFile={#WizardSmallImageFilesDir}Rubberduck.Duck.Small.*.bmp
    WizardImageFile={#WizardImageFilesDir}Rubberduck.Duck.*.bmp
    

The files exist at the expected location, and are valid bitmaps. However, on AppVeyor we get this error:

Creating output directory: C:\projects\rubberduck\Rubberduck.Deployment\InnoSetup\Installers
Reading file (LicenseFile)
Reading file (WizardImageFile)
   File: C:\projects\rubberduck\Rubberduck.Deployment\InnoSetup\Graphics\WizardImageFiles\Rubberduck.Duck.*.bmp
Error on line 81 in C:\projects\rubberduck\Rubberduck.Deployment\InnoSetup\Rubberduck.Installer.Build.iss: Could not read "C:\projects\rubberduck\Rubberduck.Deployment\InnoSetup\Graphics\WizardImageFiles\Rubberduck.Duck.*.bmp".
Error: The filename, directory name, or volume label syntax is incorrect.
Compile aborted.

We install Inno Setup using Chocolately. We found that we had to explicitly specify the version; otherwise, it'd use 5.5.9 instead of 6.0.5:

Original:

  - cinst innosetup -version 5.6.1

Modified:

  - cinst innosetup --version=6.0.5

Full AppVeyor console output (includes several pragma message) can be seen here.

Full ISS build script can be seen here.

Full Appveyor YML can be seen here.

Why would it work locally but fail on Appveyor?


Solution

  • Although you claim otherwise, you are still using 5.5.9:

    Compiler engine version: Inno Setup 5.5.9 (u)

    Wildcards in Wizard*ImageFile directives are supported since Inno Setup 5.6 only.

    Though your script seems to install 6.0.5. As it is a different major version, it's in a different path, C:\Program Files (x86)\Inno Setup 6\ rather than C:\Program Files (x86)\Inno Setup 5\. AppVeyor comes with 5.5.9 preinstalled, which is probably, why, when time comes to run the build script, 5.5.9 gets executed instead. Try using the full path to the iscc to ensure, that you are running the correct major version of Inno Setup.