Inno-Setup-Action icon indicating copy to clipboard operation
Inno-Setup-Action copied to clipboard

[BUG] Unable to pass custom params via /D

Open UMDev-Brian opened this issue 1 year ago • 10 comments
trafficstars

This is my job step: - name: Create installer uses: Minionguyjpro/[email protected] 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?

UMDev-Brian avatar Feb 23 '24 20:02 UMDev-Brian

This is my job step: - name: Create installer uses: Minionguyjpro/[email protected] 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 avatar Mar 14 '24 14:03 Minionguyjpro

This is my job step: - name: Create installer uses: Minionguyjpro/[email protected] 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 }}.

Minionguyjpro avatar Mar 15 '24 15:03 Minionguyjpro

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.

UMDev-Brian avatar Mar 15 '24 15:03 UMDev-Brian

@UMDev-Brian Any news on this?

Minionguyjpro avatar Jun 19 '24 13:06 Minionguyjpro

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

HollowGraphic avatar Jun 20 '24 18:06 HollowGraphic

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

Any more news yet?

Minionguyjpro avatar Sep 30 '24 14:09 Minionguyjpro

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/[email protected]
        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 😁

asser-dk avatar Oct 24 '24 13:10 asser-dk

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/[email protected]
        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 😁

Thanks for your suggestion! I'll try adding it into the main branch. Could someone test it afterwards by replacing their version of the step by main to make it up with the branch?

Minionguyjpro avatar Dec 22 '24 20:12 Minionguyjpro

I have added this change plus .join to make it into a single string, should work. Am testing with someone else right now.

Minionguyjpro avatar Dec 23 '24 08:12 Minionguyjpro

i test current @main version and it works with /D params like. It's nesse

- name: Compile .ISS to .EXE Installer
        uses: Minionguyjpro/Inno-Setup-Action@main
        with:
          path: frostwolf.iss
          options: |
            /O+
            /DMyAppVersion=${{ github.ref_name }}
            /DMySourcePath=${{ github.workspace }}
            /DMyBuildPath=${{ github.workspace }}\build\${{ matrix.targetPlatform }}
            /DMyOutputDir=${{ github.workspace }}\setup\${{ matrix.targetPlatform }}
            /DMyPassword=1
            /DMyAppPlatform=${{ matrix.targetPlatform }}

It is important to understand that double quotes are escaped and this will not work.

- name: Compile .ISS to .EXE Installer
        uses: Minionguyjpro/Inno-Setup-Action@main
        with:
          path: frostwolf.iss
          options: |
            /O+
            /DMyAppVersion="${{ github.ref_name }}"

Zeph1rr avatar Dec 23 '24 11:12 Zeph1rr