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

MsiSetProperty not working

Hi,

I am working with a InstallScript MSI Project.

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, I 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?

According to the Help topic this should be a simple task.
Help topic on MsiSetProperty
Labels (1)
0 Kudos
(2) Replies
danjal
Level 5

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
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 to joshstechnij, Acresso Software Engineer.

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