colmde
Posts: 2
Joined: Tue Jun 20, 2023 10:11 am

How do I refer to a file from codebase when using a custom signing tool?

I'm creating an installer and I'd like to sign the components and the installer itself with a custom signing tool.

So I choose the signtool.exe from the codebase by clicking on the [...] and just browsing to the file.

After that, all I can do is specify the command line arguments.

I need to specify the certificate file in the command line
e.g.

Code: Select all

sign /f "MyCertificate.cer"   ... etc. 
The only way I can get this to work is to specify an absolute path e.g.

Code: Select all

sign /f "C:\Certificates\MyCertificate.cer"   ... etc. 
However, I'd like it to get the certificate from the codebase as well, in the same way it does the signing tool, and the same way it does if you choose the cert file with the "Built In" signing tool. I've tried the following:

1. as in the first example above - not specifying the path and having the cert file in the same location as the signing tool hoping that it would run in the local dir.

2. Specify the path to the file in the code base (this is how it's displayed when you browse to the signing tool or the cert file in the built in)
e.g.

Code: Select all

sign /f "C:\code\MyProject\setup\signing\MyCertificate.cer"   ... etc. 
...but neither of those work.
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: How do I refer to a file from codebase when using a custom signing tool?

Hello and welcome to our forums,

When using the "Custom" option, we need to make use of the signtool.exe command line, which I'm afraid might not support what you need right now.

However, I would say this is a valid scenario and therefore I have added it on our TODO list of improvements.

Hopefully, such option will be available in a future version of Advanced Installer.

Thank you for bringing it to our attention!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
colmde
Posts: 2
Joined: Tue Jun 20, 2023 10:11 am

Re: How do I refer to a file from codebase when using a custom signing tool?

Thanks for your response Catalin,

Would it be possible to know the current directory while this step is running (and more importantly if it's part of the overall project), that way I could put a relative path into the command line arguments? I had previously assumed it was the location of signtool.exe

e.g. if it was the location of the setup.ai file, I could say something like

Code: Select all

sign /f "signing\MyCertificate.cer" ... 
Thanks!
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: How do I refer to a file from codebase when using a custom signing tool?

Hello,

Please note that this requirement, if possible, is mostly related to SignTool.exe and if it accepts relative paths.

For instance, I would assume the working directory is the one of the signtool.exe tool.

That being said, we can try having the certificate in that folder and the relative path might work.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”