kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Setup EXE running within a specific domain?

Tue Feb 13, 2018 9:33 pm

Hi,
I've searched the help and online resources but haven't found the answer to this question thus far.

We need to conditionally install a set of files for users of our application but only if the user is a part of a specific domain (Active Directory). For those users that are regular desktop users, not connected to the specific domain, we want to not install these same files.

Is there an example/suggestion of how the context of our running Setup EXE can reveal whether or not the installation is occurring on a PC which belongs to an active directory domain?

Thanks,
Kevin

Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Setup EXE running within a specific domain?

Wed Feb 14, 2018 1:03 pm

Hello,

This scenario could be implemented in the following way:

- first you need to store the content of USERDOMAIN environment variable into a property. To achieve this go to "Custom Actions" page and create a new "Set Installer Property" custom action configured in the following way:

Code: Select all

Property : PROP
Value : [%USERDOMAIN]
-than you need to condition the installation of the files according to the user domain. Just select a file from "Files and Folders" page and press F8 (go to component). In the condition field of the component associated with this file enter a condition similar to:

Code: Select all

PROP="Expected Domain"
This method will ensure the file will be installed only if the User domain is the expected one.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Setup EXE running within a specific domain?

Fri Feb 23, 2018 5:04 pm

After a few failed attempts I found that I had to make the property be a Public property. I did that with the Install Parameters. It seems to be working as expected now...Thanks for the help.

Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: Setup EXE running within a specific domain?

Mon Feb 26, 2018 9:51 am

Hello.

You are welcome!

Just let me know if you have any other questions.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Setup EXE running within a specific domain?

Thu Jun 28, 2018 7:28 pm

I need to revisit this issue it seems. We want to condition the installation of a file based on the user's domain, actually membership in any of two domains; let's call them "BERT" and "ERNIE".

I created a custom action during the install sequence with set's my property as follows:

Code: Select all

Property: USER_DOMAIN_PROP
Value: [%USERDOMAIN]
(Qu: are the square brackets needed?)

Then, in the Organization area, for each of the components I want to be affected by this property I have set the

Code: Select all

Condition: USER_DOMAIN_PROP ~= "bert" OR USER_DOMAIN_PROP ~= "ernie"
That is, I'm trying to do a case-insensitive test, so that all of these should return true "bert", "Bert", "BERT" etc,

I have some user's that are working as expected, but I have others that are in the "BERT" domain where it is not working as expected. Apparently one of the user's where it is failing is having their installation scripted using these Setup exe switches

Code: Select all

/quiet /norestart
So, within the details above am I doing something incorrectly?
Secondly, could the "/quiet" or "/restart" switches be negatively impacting the end result?
And, third, how do I go about adding to the installation log file the name of the domain that the user is authenticated on at the time of the installation, so we can find out if the expected value is recorded? It doesn't seem to be recorded in the install.log file by default.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Setup EXE running within a specific domain?

Thu Jul 05, 2018 9:45 am

Hello,

I am not so sure why this happens. Please make sure that your set installer property action is added as a custom action with sequence scheduled in the "Install Execution Stage" in "Custom Actions" page. During a silent installation only the "Install Execution Stage" is executed, the "Wizard Dialogs Stage" is skipped.

To check the value of the current user domain you can create an installation log and search for the value of your property (USER_DOMAIN_PROP) or you could search for "ComputerName" and "USERNAME" property values and check the domain name included.

If this is still of no help, can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Setup EXE running within a specific domain?

Mon Jul 09, 2018 9:26 pm

Hi Daniel,
Thanks for the ideas. I did have the property being set in the "Wizard Dialogs Stage" and not in the "Install Execution Stage" and apparently the failing scenarios are ones where the installation is being silently scripted as "/quiet /norestart". So this must be the issue.

Should my "SET_USER_DOMAIN" custom action appear in both the "Wizard Dialogs Stage" and the "Install Execution Stage"? Or should it appear only in the "Install Execution Stage"? My install needs to be able to support silent and non-silent scenarios.

If it should be in both areas what is the best way to accomplish that?

Similarly I have discovered that my custom bat file to copy the MSILogFIleLocation (intsall log file) which should be copied to the user's "My documents" tree is only being executed for non-silent scenarios...because that custom property is triggered by the UI event of the "Finish" button on the Exit dialog. How can I ensure that the install log file is going to be copied for the silent install scenarios as well since there will be no "Finish" button in that case.

Thanks,
Kevin

kjullion
Posts: 176
Joined: Mon Nov 11, 2013 9:02 pm

Re: Setup EXE running within a specific domain?

Wed Jul 11, 2018 5:51 pm

Hi Daniel,
I've tried moving my "SET_USER_DOMAIN" custom action to the top part of the "Install Execution Stage" but still during the Silent installation scenario my custom property is not getting set, or so it seems. Is there a blog or help page that dissects more the Install with sequence concepts?

I still also have the outstanding question above about how to copy my MSI log file during a silent install. Currently, the copy action is scripted to occur when the user hit's the "Finish" button on the wizard dialogs, but during a silent install there is no "Finish" button. What event can I tie into during silent installs to ensure that the MSI install log file is copied to a user folder?

Thanks,
Kevin

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Setup EXE running within a specific domain?

Tue Jul 17, 2018 6:46 am

Hi Kevin,

I apologize for the delayed reply.

I'm not sure why the "USER_DOMAIN_PROP" is still not set during a silent install after you moved your custom action on the "Install Execution Stage" section. Can you send me a verbose log of the installation, so I can investigate it?

My recommendation is to add this custom action on both stages by right-clicking it, then selecting the "Sequence -> Wizard Dialogs" option. Place it after the "Searches" action group on both stages then select the "Advanced execution scenarios..." blue link and check the "Skip action in Install Execution Stage if executed in Dialogs Stage" option.

In order to be able to copy the log file during a basic or silent install, you can try to add a new copy custom action with sequence after the "Install Execution Stage -> Finish Execution" action group and set the "UILevel < 5" condition for it. However, it may happen that the installer will still keep the file in use at that point which can block its copy.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”