1

Passing installation path selected from Destination Folder Dialog as input to a DLL from a custom dialog.

I am designing a basic MSI installer project using InstallShield 2012. I have designed a custom dialog to get user login info etc. in a custom dialog and it passes the details to the DLL which then creates a database accordingly. However I need to know how to pass the installation path [chosen in Destination Folder Dialog] as input to the dll so my DB is created inside the proper folders. My DLL action is executed after Installfiles.

Thanks in advance !! I'd be happy to explain if you are unable to understand the above ..

Arun
  • 584
  • 1
  • 6
  • 19

1 Answers1

1

You can't pass the values to the DLL directly, like in a command line.

You would store the values entered by user in a property, then your DLL custom action uses MsiGetProperty to get these properties from MSI session.

If your custom action needs to be run elevated during the commit phase of the installer, you'll have to pack both values in CustomActionData property. See Obtaining Context Information for Deferred Execution Custom Actions for more information.

Alexey Ivanov
  • 11,541
  • 4
  • 39
  • 68
  • I tried calling the dll function with the param INSTALLDIR from my custom dialog and i was able to get the installation path in IMMEDIATE Execution, but u mean to say this will not work when i try defer execution ?? – Arun Oct 08 '12 at 17:26
  • Yes, it won't work for deferred execution. In this case, in the execution sequence you have to set `MyCustomActionName` property, and in your function you obtain it under the name `CustomActionData`; here `MyCustomActionName` is the name of your deferred custom action. That is you set a property with the same name as the custom action. And only _one_ property can be passed to deferred custom actions. – Alexey Ivanov Oct 08 '12 at 19:05
  • I need to pass ten fields including the installation directory to the dll so it can create a database , is there any way to work around this ? – Arun Oct 09 '12 at 11:05
  • [link]http://helpnet.flexerasoftware.com/installshield19helplib/helplibrary/AccessingProps-DeferredCAs.htm . Using CustomActionData to Access More Than One Property ... This should work right?? – Arun Oct 09 '12 at 11:40
  • Yes, it will work. However, you should be aware that the symbol ';' itself becomes the invalid symbol for value of any of the properties you pass because now it has a special meaning. – Alexey Ivanov Oct 09 '12 at 13:24