'Building installer in a gitlab ci stage

In gitlab ci, I manage to build a solution, then I need to build an installer. It fails with an unknown option error.

In the setup stage I get this error:

Inno Setup 6 Command-Line Compiler

Copyright (C) 1997-2020 Jordan Russell. All rights reserved.

Portions Copyright (C) 2000-2020 Martijn Laan. All rights reserved.

Portions Copyright (C) 2001-2004 Alex Yackimoff. All rights reserved.

Unknown option: -c

Unknown option: -c

Inno Setup 6 Command-Line Compiler

Copyright (C) 1997-2020 Jordan Russell. All rights reserved.

Portions Copyright (C) 2000-2020 Martijn Laan. All rights reserved.

Portions Copyright (C) 2001-2004 Alex Yackimoff. All rights reserved.

ERROR: Job failed: exit code 1

Here is my .gitlab-ci.yml file:

stages:
 - build
 - setup

build:
 image: mono:latest
 stage: build
 script:
  - 'nuget restore'
  - 'MONO_IOMAP=case msbuild /t:Build /p:Configuration=Release;Platform="Any CPU"'
 artifacts:
  paths:
   - MyApp/bin/Release/
   - MyApp/Inno/
   
setup:
 image: amake/innosetup
 stage: setup
 script:
  - 'compil32 /cc "Path/To/MyAppSetup.iss"'
  #- 'iscc "Path/To/MyAppSetup.iss"'
  • Am I using the right innosetup command (compil32)?
  • Same error with iscc command
  • I can't see where the -c option comes from
  • Any idea of whate is going wrong?

Reference: Inno Setup Help



Solution 1:[1]

As I could not know where was the problem, I decided to use a docker image for innosetup:

There I need a docker in docker step with dind and a docker docker.

build:
  stage: build
  image: docker:18
  variables:
    DOCKER_DRIVER: overlay2
  services:
    - docker:dind
  script:
    - docker run --rm -v "$PWD:/work" amake/innosetup /dMyAppVersion=$MY_VERSION_NO "Path/To/MyAppSetup.iss"
  artifacts:
    paths:  
      - Path/To/bin/MyApp-*-Setup.exe

Solution 2:[2]

You need to overwrite the default entrypoint to run your script properly:

setup:
 image:
   name: amake/innosetup
   entrypoint: [""]
 stage: setup
 script:
  - iscc "Path/To/MyAppSetup.iss"

I also had to use iscc instead of compil32, got that idea from the dockerfile

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sinsedrix
Solution 2 Jakob Lenfers