Hello,
Am I to assume that I will need to create my own Custom Action that will achieve the result I desire. If this is the case, is there an example I can use to create an appropriate dll and have it executed by AI.
In this specific scenario, the answer would be yes, since Advanced Installers only offers the possibility to register the DLLs shipped with your setup package.
For this, I believe you could use any custom action (e.g. batch script, PowerShell script, .NET DLL, etc.).
What we need to note here is the fact that the custom action will most likely need to be run elevated (with administrator privileges).
If this is the case, is there an example I can use to create an appropriate dll and have it executed by AI.
Unfortunately, I do not have a .DLL for this, but I have played a little bit with PowerShell and here is what I have come up with:
- RegisterGACPowerShell.png (117.1 KiB) Viewed 5771 times
The above could be added in your project as a
"Run Inline PowerShell Script", with the following options:
- first of all, we can schedule this after the
"Add Resources" action group
-
"Execution Time" set to
"When the system is being modified (deferred)"
OBS: There are two reasons why we have the above execution option.
1st: By registering the DLL to GAC, we are modifying the system and it is recommended that all actions that modify the systems are scheduled during the deferred stage.
2nd: we need to run the custom action elevated
- under
"Execution Options", we will need the
"Run under the LocalSystem account with full privileges (no impersonation)" option (to run the custom action elevated)
Now, if you would like to go with the .DLL approach, here would be the required steps:
- develop the code that will register the .DLL files to GAC
- create the C# custom action -->
"How to create fully fledged C# custom actions"
- use one of our
"Call function from DLL" predefined custom actions -->
"Custom Actions List"
OBS2: The options would be pretty much the same as for the PowerShell custom action.
Hope this will help!
Best regards,
Catalin