PowerON-UK / AKV-Code-Sign

Azure Key Vault Code Signing DevOps Pipeline Extension
MIT License
1 stars 0 forks source link

taskSetup - Install the tool AzureSignTool to the local machine using the dotnet CLI #1

Closed mkossiek closed 1 year ago

mkossiek commented 1 year ago

On our OnPrem- BuildAgent-Machines AzureSignTool is already installed. (And if not it will be after the first run of this task.) So using this task we always get the error message: .... Running Pre Signing Activities "C:\Program Files\dotnet\dotnet.exe" tool install --global azuresigntool

[error] "azuresigntool" is already installed.

Is it possible to configure this pre-signing installation using a variable?

ld0614 commented 1 year ago

Hi @mkossiek

We already try to handle this behavior silently on this line https://github.com/PowerON-UK/AKV-Code-Sign/blob/88b30703aad8fc791916f681643189d7c7c8e033/task/taskSetup.ts#L12C110-L12C110 but it looks like the output your getting is slightly different which is then tripping up as I believe the output in your case doesn't start with the word Tool.

This should be a simple enough fix by changing it from a startsWith to a contains and handling both single and double quotes. I'll try and get some time this week to test and push an updated version

mkossiek commented 1 year ago

Hi thanks for quick response. I shortened the logs a bit because I have them in German here. (have to check why) This is the whole output:

Task : Azure Key Vault Code Sign Description : Azure Key Vault Code Signing DevOps Pipeline Extension Version : 1.0.2 Author : PowerON Platforms Help :

Running Pre Signing Activities "C:\Program Files\dotnet\dotnet.exe" tool install --global azuresigntool Das Tool "azuresigntool" ist bereits installiert.

[error]Das Tool "azuresigntool" ist bereits installiert.

It works now using the Pre and post script tasks as a workaround:

- task: Pre-CmdLine@2
    inputs:
      script: 'dotnet tool uninstall -g azuresigntool'
ld0614 commented 1 year ago

Thanks for the update and for posting the workaround. The fact that the server is in German is likely the issue as the check won't be translating the string. It should be an easy enough fix by just adding the German string to the check 😄

ld0614 commented 1 year ago

@mkossiek I've just pushed version 1.0.3 to the marketplace which includes a bypass for that error in German as well, could you test and let me know if it fixes your issue please?

mkossiek commented 1 year ago

@mkossiek I've just pushed version 1.0.3 to the marketplace which includes a bypass for that error in German as well, could you test and let me know if it fixes your issue please?

Looks very good! Runs without my workaround. Thank you very much!

ld0614 commented 1 year ago

Wonderful News!