We are attempting to create an MSI package installer that installs two prerequisites (both are executables). We have included PowerShell scripts as custom actions ("Run PowerShell script file" actions and attaching the scripts) that are meant to run during uninstall, which uninstall the prerequisites upon uninstalling the entire package. The scripts work as expected when testing them in the Sandbox environment without enabling digital signing, but when the package is actually deployed all scripts will need to be signed. The problem we are facing is very similar to the problem discussed here: viewtopic.php?t=34363
When testing the package on our machine, temp files of the scripts are being created which are not being signed, therefore the scripts won't run. We have enabled signing and included a code signing certificate from the certificate store through the digital signature tab. By the way, this certificate is also included in the Trusted Publishers list. Here is the part of the log that shows the problem:
(We have also tried the workaround that was explained in the post mentioned above by Sorin, but the scripts still do not run.)Dumping PowerShell invoke log ...
--> Found PowerShell path: C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
--> PowerShell Script Execution Result Code: 1
--> PowerShell Script Execution log:
File C:\windows\SystemTemp\pss6EFF.ps1 cannot be loaded. The file C:\windows\SystemTemp\pss6EFF.ps1 is not digitally
signed. You cannot run this script on the current system. For more information about running scripts and setting
execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
CustomAction ur returned actual error code 1603 but will be translated to success due to continue marking
When attaching the scripts, we have also checked the "digitally sign the script" option under the "PowerShell script options" link.
What can we do so that the scripts actually get signed and run? I sent an email to support at advanced installer dot com with more details about how to reproduce the issue
Thanks,
Kattie