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