strick
Posts: 14
Joined: Fri Jul 09, 2010 2:12 pm

Server install versus PC install - Appliation folder

Is there a way where my installer can recognize that it is installing on a server, and if so, install the a d:\. And if not a server than install to c:\?
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Server install versus PC install - Appliation folder

Hello,

In order to detect if the target OS machine is a server, you can use IsWindowsServer function. This function has the return value true if the current OS is a Windows Server version; otherwise, false.
Depending the return value of the function you can set accordingly the APPDIR property. For this you can use the MsiSetProperty function which sets the value for an installation property.

We recommend you to use a DLL custom action for example, you can create your custom action as a custom action written in C# or a custom action written in C++,

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence after the Paths Resolution standard action from the Install Execution Stage. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Please let us know if that helped, otherwise give us more details about your specific scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”