Run powershell script with AI msi - Advanced Installer Community
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Run powershell script with AI msi

Hi,

I have a powershell script, which i need to run in a AI msi/exe package.
I cant figure out where and HOW to set this up in the custom actions.

Can anyone help me?

Best regards
BDP
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run powershell script with AI msi

Hi,

To achieve this, you can go in the "Custom Actions" page and add a Run Windows PowerShell Script predefined custom action.

You can take a look on the Running a powershell script thread which discusses a similar issue.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run powershell script with AI msi

Hi E,

I dont understand that thread.
I managed to look at my other packages which work, and i have setup the custom action to run the powershell script, like this:

Look here: https://www.dropbox.com/s/552hv0j0gchr18s/fix.jpg?dl=0

If i run this, it only opens the powershell.ps1 file in notepad! :/

What could be wrong?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run powershell script with AI msi

Hi,

Please keep in mind that, as I mentioned in my previous post, you should add the Run Windows PowerShell Script predefined custom action, not the "Launch file" custom action that is shown in your screenshot.

Also, when you use that custom action, you should write your powershell code in the "Script Text" field, you cannot run directly the powershell file.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run powershell script with AI msi

Okay, but where do i add the predefined custom action? and insert the powershell script into the "Script text" field?
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run powershell script with AI msi

Hi Eusebiu,

Sorry i found it and tried this solution:
Please look here: https://www.dropbox.com/s/ooa0bwokvjo8z ... t.jpg?dl=0

Some of the script is executed, since the onedrive program is closing down but then the msi just stalls and "hangs"

Any idea why?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run powershell script with AI msi

Hi,

I'm not sure why this happens. Can you reproduce the problem on multiple clean machines?

If so, can you please send us a verbose log of the installation to support at advancedinstaller dot com, so we can investigate it?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run powershell script with AI msi

I tested it again and it stalls, and there is 3 processes of the ms msi

Here is the log:

https://www.dropbox.com/s/dvdvam2yiox7t ... e.log?dl=0

Please help
dfbdp
Posts: 25
Joined: Mon Jan 06, 2014 9:00 am

Re: Run powershell script with AI msi

Hi Eusebiu,

Do you see any errors in the logfile or can i send you the files for review?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Run powershell script with AI msi

Hi,

Unfortunately, I did not get the chance to download your log file because it is removed. You can send it along with your files to support at advancedinstaller dot com, so we can investigate them.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”