Posts

Showing posts with the label property passing

Using SOURCEDIR Property in Package

SOURCEDIR property in MSI package refers to the location from where the MSI is installed in the machine. How do we use this property in our package. If you want to use a file which is kept in the source folder (next to where your MSI is placed), through Custom Action then you need to follow this procedure. The SOURCEDIR cannot be directly used in the package. If you read the logs then SOURCEDIR property is created and correctly pointed to the directory. But later the log shows that: Deleting SOURCEDIR... So the value of this property is deleted and the MSI does not get access to it. If you display message with [SOURCEDIR] property then it will be empty. The work around for this is that we can put an Action in the sequence called: "ResolveSource" after CostFinalize action. Then if you place your Custom Action after this action which refers to SOURCEDIR property then you will get the correct value of SOURCEDIR. Acknowledgement: I would like to thank my friend, Anurag, here who ...

Property passing in Custom action

If you want to pass property or a directory in Custom action then u can use Set Property Custom Action and place it after Cost Finalize. Name the property with the name of the Custom Action you want to pass it to. Then you can retain this property in Custom Action by Session.Property, If you are running this Custom Action in Deffered mode then you need to pass parameter as CustomActionData and if you are running this CA in Immediate Execution then you need to directly pass the property name.You can pass more that one property, by set property CA, by separating it with ";"Also while retrieving these valuues you need to split the variable in you retrieved from Session.Property.