marceloavf
Posts: 10
Joined: Mon Jan 15, 2018 11:05 am

[Custom Action] Fail to execute powershell script

When I try to run powershell script on Install execution stage, the anti-virus report the .ps1 file as an malware and block it.
Even if I try to execute When system is being modified with full privileges option.

Image

The script:

Code: Select all

Stop-Service -Force WAS
Remove-Item -Recurse -Force C:\inetpub\temp\appPools\*
if(Test-Path IIS:\AppPools\InovaFarmaWebApi) {
    Remove-WebAppPool -Name InovaFarmaWebApi
}
if(Test-Path IIS:\Sites\InovaFarmaWebApi) {
    Remove-WebSite -Name InovaFarmaWebApi
}
if(Test-Path IIS:\AppPools\InovaFarmaApi) {
    Remove-WebAppPool -Name InovaFarmaApi
}
if(Test-Path IIS:\Sites\InovaFarmaApi) {
    Remove-WebSite -Name InovaFarmaApi
}
Start-Service W3SVC
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: [Custom Action] Fail to execute powershell script

Hello,

Unfortunately in this situation the only thing you could do is to contact Avast and request them to white-list your package.

As a best practice, we recommend that before every release of the package to perform an AV scan it (for example using www.virustotal.com) and if there are any false-positive detections, contact the AV software manufacturers and request them to whitellist your package.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
marceloavf
Posts: 10
Joined: Mon Jan 15, 2018 11:05 am

Re: [Custom Action] Fail to execute powershell script

Nice, I was able to make it run by using script file instead of inline script, so I digitally signed it.

But now I having this kind of error: IIS Error 4020
I'm sending the .log of the installation.
thanks!
Attachments
installation.log
(839.87 KiB) Downloaded 270 times
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: [Custom Action] Fail to execute powershell script

Hello,

The log file you've attached seems to be incomplete. I couldn't find the error you've mentioned in it.

In order to be able to further investigate this issue, please send us the .AIP (project) to support at advancedinstaller dot com along with more details regarding the running environment : OS type and architecture (x86/x64). Could you reproduce this issue on multiple clean machines?

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”