davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Modify MSI Properties in a .NET Custom Action

Hello,

Within a .NET Custom Action you can access installer properies by using

Code: Select all

Context.Parameters["Propertyname"]
Is it possible to change / set these properties from within a custom action?
Using

Code: Select all

Context.Parameters["Propertyname"]="NewValue"
has no effect




Thanks,


Dave
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Modify MSI Properties in a .NET Custom Action

Hi Dave,

I am afraid this is not supported using .Net Custom Actions. Dot Net custom actions are only used for configuring your assembly. You can use C/C++ or VBScript custom actions instead.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Re: Modify MSI Properties in a .NET Custom Action

Hello - thanks for the information - I'll see if theres a way to work around this with VBScript

I see that .NET Custom Actions don't have access to the MSIHandle so they can't call the MsiSetProperty - I take it there is no way to pass the handle to the custom action via properties?
http://msdn.microsoft.com/en-us/library ... S.85).aspx
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Modify MSI Properties in a .NET Custom Action

Hello,

It would be possible to pass the handle to the .net custom action. Nonetheless you wouldn't be able to use this handle since your custom action would be running under a different process.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Re: Modify MSI Properties in a .NET Custom Action

Ah OK thanks for clearing that up

Return to “Common Problems”