Hello,
Can you please give an example of how to use https://www.advancedinstaller.com/user- ... ature.html?
TIA,
Obay
Code: Select all
$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject("D:\PS support\sample.aip")
$project.DigitalSignature.EnableSigning() = 1
$project.Save()
Code: Select all
$project.DigitalSignature.SetUseFileFromDisk("D:\mycertificate.pfx")
Code: Select all
$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject("D:\sample.aip")
$CertificatesList = $project.DigitalSignature.Certificates
foreach ($element in $CertificatesList) {
if (($element.Thumbprint -eq "8c5a55d94c9d4d6f8b0e8f4644768f00bf65dd2c") -and ($element.Store -eq "User\MY"))
{
$certificate = $element
$certificate
}
}
$project.DigitalSignature.SetUseFromPersonalCertificate($certificate)
$project.Save()