We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

NovAtel
Posts: 13
Joined: Mon Mar 18, 2019 9:58 pm

Updating "Install MSIX/APPX Package" Custom Action With PowerShell

Hello,

I am trying to update the "Path" property of an "Install MSIX/APPX Package" custom action using PowerShell (using Advanced Installer version 19.2)
I can access the custom action in PS but my question is how do I update the path?

I'm not sure if I see a corresponding implementation of ICustomAction in the documentation?
https://www.advancedinstaller.com/user- ... onent.html




$advinst = New-Object -ComObject AdvancedInstaller
$project = $advinst.LoadProject($aiProjectPath)
$project.CustomActionsComponent.CustomActions[2]


OUTPUT:
Name : ExecutorAppx
RunUnderLocalSystemAccount : False
WaitToFinish : True
FailInstallationIfReturnsError : True
ExecutionTime : Deferred
UiSequenceCondition :
ExecuteSequenceCondition : System.__ComObject
Object



and,


$project.CustomActionsComponent.CustomActions[2] | Get-Member


OUTPUT:
TypeName: System.__ComObject#{253c1946-fbfe-46c7-aa61-6d969d6d3967}

Name MemberType Definition
---- ---------- ----------
CreateExecuteSequence Method void CreateExecuteSequence (string)
CreateUiSequence Method void CreateUiSequence (string)
RemoveExecuteSequence Method void RemoveExecuteSequence ()
RemoveUiSequence Method void RemoveUiSequence ()
ExecuteSequenceCondition Property ICustomActionSequence ExecuteSequenceCondition () {get}
ExecutionTime Property string ExecutionTime () {get} {set}
FailInstallationIfReturnsError Property bool FailInstallationIfReturnsError () {get} {set}
Name Property string Name () {get} {set}
Object Property uint Object () {get}
RunUnderLocalSystemAccount Property bool RunUnderLocalSystemAccount () {get} {set}
UiSequenceCondition Property ICustomActionSequence UiSequenceCondition () {get}
WaitToFinish Property bool WaitToFinish () {get} {set}



Thanks
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Updating "Install MSIX/APPX Package" Custom Action With PowerShell

Hello,

Unfortunately, we do not currently have any predefined support for that specific Custom Action.

What you see using the get-member cmdlet is basically what every custom action has.

I have added this on our TODO list of improvements and hopefully it will be available in a future version of Advanced Installer.

When this will be added, I will update this forum thread.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Updating "Install MSIX/APPX Package" Custom Action With PowerShell

Hello,

As a followup, we have already added this improvement and it should be available in our next release.

The whole script would look something as it follows:

Code: Select all

$advinst = new-object -com advancedinstaller
$prj = $advinst.LoadProject("D:\MyAppInstaller.aip")
$installMsixCA = $prj.CustomActionsComponent.CustomActions[0]
$installMsixCA.MsixPath = "D:\MySecondApp.msix"
$prj.Save()
I will notify this thread once we will release the new version.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Updating "Install MSIX/APPX Package" Custom Action With PowerShell

Hello,

This improvement has been added in version 19.4 of Advanced Installer, released on April 26th, 2022.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”