cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
danjal
Level 5

How does FeatureSetTarget work?

Hi,

My project is a InstallScript MSI Project.

Under Internet Information Services, I have created an Application Pool.
Under Identity for the Application Pool I have set Username to and Password to

Under the OnFirstUIBefore event, I have a dialog where I ask for a username and password, that the application pool shall run under.

After the username and password are specified I call:
FeatureSetTarget(MEDIA, "", wsUserAccount);
FeatureSetTarget(MEDIA, "", wsPassword);

But the text is not substituted when the application pool is installed :confused:
The features are all defined under Organization>features.
What am I doing wrong?

Thanx.
Labels (1)
0 Kudos
(6) Replies
DebbieL
Level 17

Have you tried the procedure in the following help topic?
Using Windows Installer Properties to Dynamically Modify IIS Settings
0 Kudos
danjal
Level 5

I have looked at MsiSetProperty, but it does not work.

Here is what I am doing.
I make a new application pool under Internet Information Services > Applicaton Pools.
Under Identity at choose Configurable and in User Name, I enter [MYIWUSER].

In the onFirstUIBefore event, I enter this code:
MsiSetProperty(ISMSI_HANDLE, "MYIWUSER", "MYTEST");

After running the installation the field User Name should contain MYTEST, but instaid it is empty.

What am I missing? some property settings?, include files?, set ISMSI_HANDLE to something?, something to do with IS_IIS_DO_NOT_USE_REG? :confused:

According to the Help topic this should be a simple task.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Using MsiSetProperty would be the appropriate way to dynamically set the username/password identity information for application pools. If this is not working, more information is needed to troubleshoot the issue. For instance, is this issue occurring on some machine or all machines, what versions of IIS is this occurring with? Also, a verbose log of the installation should be created to determine if the property is being set and if it is being passed to the execute sequence.
0 Kudos
danjal
Level 5

The machines that I am testing on are Windows 2003 with IIS6 and
Windows 2008 with IIS7.

But I think I am closer to where the problem is. It has something to do with FeatureMoveData.
In our installation there is a program that we need to extract before the rest of the installation can continue. We use this program to test windows users and other stuff.

So in our onFirstUIBefore event the code is something like this:

//deselect all feature other then the one where our program is attached
FeatureSelectItem(MEDIA,"Webservice",FALSE);
FeatureSelectItem(MEDIA,"Webportal",FALSE);
FeatureSelectItem(MEDIA,"Installdatabase",FALSE);

//move our program to disk
FeatureMoveData(MEDIA,nvDisk,0);
//reset internal structures
FeatureMoveData("",nvDisk,0);

//select all features and ask the user what features he whants to install
FeatureSelectItem(MEDIA,"Webservice",TRUE);
FeatureSelectItem(MEDIA,"Webportal",TRUE);
FeatureSelectItem(MEDIA,"Installdatabase",TRUE);
Dlg_SdFeatureTree:
szTitle = "";
szMsg = "";
if (nSetupType = CUSTOM) then
nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2);
if (nResult = BACK) goto Dlg_SdAskDestPath;
endif;
....
....
//then some code with dialogs and checks where we use our program
....
....
//and finally calls with MsiSetProperty that do not work
MsiSetProperty(ISMSI_HANDLE, "MYIWUSER", "MYTEST");


If I put MsiSetProperty(ISMSI_HANDLE, "MYIWUSER", "MYTEST"); before the FeatureMoveData then it works - so calling MsiSetProperty after FeatureMoveData does not work even thou the application pools and websites do not belong to the feature that is moved when FeatureMoveData is called.

And it seems that calling FeatureMoveData("",nvDisk,0), which should reset internal structures (what ever that meens), has no affect.

How do I resolve this problem?:(
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

FeatureMoveData in an InstallScript MSI project does not work the same as it would normally in a pure InstallScript project. For InstallScript MSI, if this function is called, this will result in the InstallScript engine launching the MSI portion of the installation (this is normally done automatically after OnFirstUIBefore is finished). There is no "reset" functionality with this function in an InstallScript MSI project since InstallScript does not handle the file transfer.

Since FeatureMoveData is called before calling MsiSetProperty in your script, the property used by the IIS custom actions in the MSI part of the installation is not set yet, and therefore the app pool installs with a blank username.

In general, FeatureMoveData should should only be used in InstallScript projects (note that the help topic for FeatureMoveData applies to InstallScript projects only). As mentioned above, the MSI part of the installation will start after OnFirstUIBefore has completed. If a program needs to be run during the installation, it should normally be included as a support file that can be launched from SUPPORTDIR.
0 Kudos
danjal
Level 5

I moved the program files that I used during the installation to Behavior and Logic > Support Files/Billboards and use SUPPORTDIR as the path to the files in my script.
I then removed the FeatureMoveData code - and everthing works perfect.

A thousand thanks!!! 😛

NB. I did not know about Support Files feature.:o
0 Kudos