teder.ted
Posts: 1
Joined: Tue Nov 16, 2021 12:35 pm

Install a certificate at the beginning of the installation

Tue Nov 16, 2021 12:50 pm

Hi.
I add a "Custom Action" to "Install a certificate" and "Move" it to "Begin".
I set the path to a file in my local computer (e.g. D:\mycer.cer)
When I install it on my computer everything is OK. However installing it on another computer fails.
I realized that the problem is that the .cer file does not exist on target computer.
I tried to add the .cer file to the "Files and Folder" and change the path of certificate to [#mycer.cer]. But Because this file will be copied to the target PC only after "Add Resources" phase, It fails too.
Is there any solution?

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Install a certificate at the beginning of the installation

Tue Nov 16, 2021 1:41 pm

Hello and welcome to our forums,

A solution for this will be to add your certificate as a temporary file in the "Files and Folders" page.

Unlike Advanced Installer's regular files or resources, "Temporary Files" are copied on the target machine at the beginning of the installation and are deleted at the end of it, ensuring you have access to them throughout the entire install process.

Temporary Files are copied during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action.

Add your .cer certificate in the "Files and Folders" page using the "Add Temporary Files" toolbar button.

Then you can add your "InstallCertificate" custom action after the "Path Resolution" action group and in the Path field select the file from the Windows Volume -> Temporary:
cert.png
cert.png (118.22KiB)Viewed 6305 times

Also don't forget that this custom action requires administrative privileges to run, so make sure you check "Run as Administrator" option from the "Install Parameters" page.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

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

ge.oliveira
Posts: 1
Joined: Sun Jul 03, 2022 5:06 am

Re: Install a certificate at the beginning of the installation

Sun Jul 03, 2022 5:13 am

I've been trying this, but to no avail. I've tried everything, I believe. I need to put multiple certificates (.cer extension) in the installer so they can be installed on any system and not just mine, but I haven't been able to after trying several ways. Please bring me accurate guidance on this. After all, what should I do so that multiple certificates can be installed? Thanks in advance.

Liviu wrote:
Tue Nov 16, 2021 1:41 pm
Hello and welcome to our forums,

A solution for this will be to add your certificate as a temporary file in the "Files and Folders" page.

Unlike Advanced Installer's regular files or resources, "Temporary Files" are copied on the target machine at the beginning of the installation and are deleted at the end of it, ensuring you have access to them throughout the entire install process.

Temporary Files are copied during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action.

Add your .cer certificate in the "Files and Folders" page using the "Add Temporary Files" toolbar button.

Then you can add your "InstallCertificate" custom action after the "Path Resolution" action group and in the Path field select the file from the Windows Volume -> Temporary:

cert.png


Also don't forget that this custom action requires administrative privileges to run, so make sure you check "Run as Administrator" option from the "Install Parameters" page.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Install a certificate at the beginning of the installation

Mon Jul 04, 2022 7:04 am

Hello and welcome to our forums,
After all, what should I do so that multiple certificates can be installed?

In order to achieve this, just follow the steps from my previous reply for each certificate.
Please check the Install certificate custom action article.

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

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

Return to “Building Installers”