Minionguyjpro / Inno-Setup-Action

GitHub action to compile .iss (Inno Setup Script) files.
https://docs.inno-setup-action.minionguyjpro.dedyn.io/
32 stars 8 forks source link

[BUG] Unable to pass custom params via /D #28

Open UMDev-Brian opened 9 months ago

UMDev-Brian commented 9 months ago

This is my job step: - name: Create installer uses: Minionguyjpro/Inno-Setup-Action@v1.2.4 with: path: ./pos-service-setup.iss options: /o+ /DMyAppVersion=${{steps.gitversion.outputs.MajorMinorPatch}} /DMyAppBuild=${{steps.gitversion.outputs.buildMetaData}} /DAppVersionInfo=${{steps.gitversion.outputs.semVer}} /DFrontendVersion="${{github.event.client_payload.version}}" All of those parameters end up empty when the script is compiled. I even had one param hardcoded /DSourceDir=.\build, but that was also empty. I know my 'gitVersion' commands work because I'm using before and after this step. I also thought that maybe it has to do with spaces, but I've checked the all the data I'm trying to pass and none of it has spaces.

Am I missing something?

Minionguyjpro commented 8 months ago

This is my job step: - name: Create installer uses: Minionguyjpro/Inno-Setup-Action@v1.2.4 with: path: ./pos-service-setup.iss options: /o+ /DMyAppVersion=${{steps.gitversion.outputs.MajorMinorPatch}} /DMyAppBuild=${{steps.gitversion.outputs.buildMetaData}} /DAppVersionInfo=${{steps.gitversion.outputs.semVer}} /DFrontendVersion="${{github.event.client_payload.version}}" All of those parameters end up empty when the script is compiled. I even had one param hardcoded /DSourceDir=.\build, but that was also empty. I know my 'gitVersion' commands work because I'm using before and after this step. I also thought that maybe it has to do with spaces, but I've checked the all the data I'm trying to pass and none of it has spaces.

Am I missing something?

I would expect this to work either. Can you try adding another step that tries to echo one of the contexts (the ${{}}) things? Tell me whether that does return something or not.

Minionguyjpro commented 8 months ago

This is my job step: - name: Create installer uses: Minionguyjpro/Inno-Setup-Action@v1.2.4 with: path: ./pos-service-setup.iss options: /o+ /DMyAppVersion=${{steps.gitversion.outputs.MajorMinorPatch}} /DMyAppBuild=${{steps.gitversion.outputs.buildMetaData}} /DAppVersionInfo=${{steps.gitversion.outputs.semVer}} /DFrontendVersion="${{github.event.client_payload.version}}" All of those parameters end up empty when the script is compiled. I even had one param hardcoded /DSourceDir=.\build, but that was also empty. I know my 'gitVersion' commands work because I'm using before and after this step. I also thought that maybe it has to do with spaces, but I've checked the all the data I'm trying to pass and none of it has spaces. Am I missing something?

I would expect this to work either. Can you try adding another step that tries to echo one of the contexts (the ${{}}) things? Tell me whether that does return something or not.

Otherwise what you could try is adding adding a space before and after the part in the context itself, e.g. ${{steps.gitversion.outputs.MajorMinorPatch}} would become ${{ steps.gitversion.outputs.MajorMinorPatch }}.

UMDev-Brian commented 8 months ago

I ended using the workflow scripting and vanilla inno tool for the moment. I'm assigned to other things now. I will have to try this when I get back to it.

Minionguyjpro commented 5 months ago

@UMDev-Brian Any news on this?

HollowGraphic commented 5 months ago

No sorry, it'll be a quite a while longer. We're not ready to automate builds yet.

Minionguyjpro commented 2 months ago

No sorry, it'll be a quite a while longer. We're not ready to automate builds yet.

Any more news yet?

asser-dk commented 1 month ago

I ran into a similar issue. I set the OutputPath as the first argument and noticed that all addtional arguments were added to the path name. After doing some digging I think I found the bug and the potential fix.

The bug seems to be that the options are being interpreted as one single option instead of an array of options, which is what execFile() expects.

I think changing core.getInput("options") into core.getMultilineInput("options") would solve it as this would return the options as an array. This would also change the - options argument in the workflow to a list so you would define it something like:

name: Build Installer
on: push
jobs:
  build:
    name: Build the Inno Setup Installer
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4

      - name: Compile .ISS to .EXE Installer
        uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
        with:
          path: src/setup.iss
          options: |
            /o+
            /DMyAppVersion=${{steps.gitversion.outputs.MajorMinorPatch}}*

I tried to make a PR but I had issues getting the project up and running locally and I am not super strong in JS/Node so I will leave that up to someone else 😁