ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Is there an option to toggle signing certain files

Hi, I have an advanced installer project that is synchronized with a folder and want any files that can be signed to be signed for a full release.
However, in smaller releases we would prefer that not everything gets signed to reduce compile time. Is there a way to set an environment variable and toggle which files get signed?
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: Is there an option to toggle signing certain files

Also, is there a way to add signing to any files that are added via sync?
Catalin
Posts: 7305
Joined: Wed Jun 13, 2018 7:49 am

Re: Is there an option to toggle signing certain files

Hello,

I'm afraid you can not really exclude files from being signed.

Regarding the files that are added via sync, they should automatically be signed if they are eligible (e.g. exe files, dll files). Are you synched files not being signed?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: Is there an option to toggle signing certain files

Hi, the synced files do not seem to be signed by default; I have to manually add them in the Files Configured for Signing tab in the Digital Signature page
Liviu
Posts: 1280
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Is there an option to toggle signing certain files

Hello,

You can try to achieve this with our PowerShell automation support.

For example, you can use the script below to sign all files in a folder:

Code: Select all

$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject("D:\sample.aip")

$selectedFolder = $project.FoldersComponent.Folders | Where-Object { $_.Name -eq "test" } | Select-Object -First 1

# Loop through all files in the selected folder
foreach ($file in $selectedFolder.Files) {
    $file.DigitalSign = 1
}

$project.Save()
Replace "test" with the name of your folder. Using such a script, you can filter the files in the folder as you wish.

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: Is there an option to toggle signing certain files

Hi, thanks for the help
The method works, however it often adds in external files included with the project and complains about it when building that they are already signed / unable to be signed

Is there a way to avoid this?
Liviu
Posts: 1280
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Is there an option to toggle signing certain files

Hello,

Not quite sure I fully understand this.

Can you give us more details, please? Are there errors and the build fails? Or are these just warnings and the build is successful?

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ReynoldsL05
Posts: 19
Joined: Fri Oct 11, 2024 11:41 am

Re: Is there an option to toggle signing certain files

Hi, the build is successful but it seems to take longer to build which is not ideal
Liviu
Posts: 1280
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Is there an option to toggle signing certain files

Hello,

As you sign all files, the build time may increase. When the Digital Signature is performed a hash function is applied to the related files which need to be signed. Also, using the timestamp URL then establishing the connection can be a time consumer.

Let us know if there is anything else.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”