glavian999
Posts: 6
Joined: Tue Jun 09, 2009 4:35 pm

Change Target Directory based on a Service Assembly Path

I want to change the TargetDir of the install based on the assembly location of a service. What is the best way to do this and can I use a .Net Class Installer Action?

Thanks,
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Change Target Directory based on a Service Assembly Path

Hi,

I'm afraid you cannot use a .Net Class Installer Action as you need to set public properties from your custom action, for this you can use a Win32 DLL.

For locating the source file of the service you can use the options from Search page. The result of the search is stored in its name, which is actually a public property, so you can easily get it
in the Win32 DLL. After you parse the obtained path and you obtain the desired install path all you need to do is to set the property "APPDIR" to this path.

Please note that the custom action should be scheduled before the standard action "CostFinalize" from InstallExecuteSequence. Any changes of the install path after this standard action will be ignored
by the installation process.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”