Equivalent of .MST functionality?

Got a problem you cannot solve? Try here.
fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Equivalent of .MST functionality?

Postby fletcherjames » Fri Jun 23, 2006 12:02 pm

We're using 6.0 Studio. A large portion of our customers use Group Policy Installs. A couple of them have been asking about how they can get the equivalent of .MST functionality (e.g. selecting which components should be installed.)

We've already developed a .MSI with the Group Policy Wizard, and set it up to pass through command line parameters to the setup .EXE. Those allow them to select Silent mode and the TargetDir, as well as a couple of our own options. However, one customer is asking if he can fine-tune exactly which additional groups of files and utilities should be installed -- more options than we'd like to put on the command line.

One option is for us to use a .INI file to turn on/off additional files or groups, and then provide documentation for setting up that file. However, I was wondering if IA had any kind of feature either to allow the user to create a .MST, or to otherwise capture an "answer file" from a sample installation, which could then be used to select components and so forth.
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Jun 23, 2006 2:59 pm

You can play with the Save Feature Selections and Load Feature Selections commands to persist saved features to disk, and then load them from disk.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Sat Jul 08, 2006 12:07 pm

I've been trying to get this to work, and I've been running into a few frustrations. After various kinds of experiments, I came to the conclusion that the way to do this was to "Save Feature Selections" into a file in $TARGETDIR$, every time the setup is run. Then, I would plan on doing a "Load Feature Selections" during the initialization phase, specifying a file by the same name, but in the folder which contains the Setup.EXE. That way, an admin could:

* Run an install on an example machine
* Copy the SetupChoices.txt file to the same folder as the Setup.exe
* Run subsequent setups, on other machines, from the latter location.

There's only one problem: The Save Feature Selections command seems to execute before any of the actual setup has been done. As a result, $TARGETDIR$ doesn't yet exist, and the file doesn't get saved!

One workaround is to tell my clients that their admins need to manually create a target folder, before the example run. However, that's pretty chintzy.

Another possibility might be to save to some sort of temporary folder, and then copy the file from the temp folder to $TARGETDIR$. However, I'm not sure that I wouldn't run into similar timing issues -- perhaps you could tell me how to make that work, so I could avoid a trial-and-error approach.

Any suggestions??
Fletcher James

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Sat Jul 08, 2006 12:56 pm

More frustration: It would appear that the Load Feature Selections function is disabled in Silent mode. Either that, or I'm doing something which disables it. (It <does> seem to work in non-silent mode, as I can change the default settings which appear on my screen for components, by editing the file.)

Note that my placement of the Load Feature Selections statement is as the last executable statement in the Define Setup Globals region, and it is not subject to any If conditions.

If there's any way to get that file to check the "License Acceptance" form and "Press the Next" key on all of the dialogs, that's an acceptable alternative to me, even if the setup process appears visually on the screen.
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Jul 08, 2006 3:59 pm

When are you calling Save/Load?
Save saves what's been defined and selected up to that point in the script immediately.
Load immediately loads feature selections, as long as matching features have already been defined.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Sat Jul 08, 2006 6:44 pm

See attached script

Load is called during Initialize Globals, after defining Features. It works when interactive, but seems to be ignored in silent mode. If there's no way to make it work, I don't see any alternative other than doing all of my own save/load work with about 50 lines of explicit read/write logic.

Save is called at the end of the entire install procedure. It works <only> if $TARGETDIR$ exists before the setup kit is run.

File Attached:

BA_mpr.txt
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sun Jul 09, 2006 7:38 am

Fletcher:

A few things that don't make sense here.

1) If you are calling Save at the end of the entire install procedure, $TARGETDIR$ will naturally have been created. So what you say about Save only working if $TARGETDIR$ exists beforehand doesn't make much sense.

2) Load is not related at all to the silent state of the setup. So again, I don't understand why Load wouldn't work if setup isn't silent.

Can you please attach your setup project? The TXT file isn't much help, really.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 10:49 am

Here are my project files, not including our application. Please let me know if you need the app files as well -- I can e-mail to your private address.

BTW, my understanding of IA is that all of the dialogs and certain other script statements are run first, after which IA creates and runs a customized .MSI. I know that you've got different phases of .MSI processing -- uninstall of prior version, pre-requisites, main install, but I have a poor understanding of whether these are all in one .MSI run, or separate, and which IA code runs before and after each step (or, maybe I've got this ALL wrong.)

That being said, it occurs to me that the problem with the Save (if it's not due to a simple goof on my part) could be due to the Save statement running as part of the IA dialog phase, before the .MSI has created $TARGETDIR$.
Fletcher James

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 11:12 am

P.S.

Instead of telling you that "Load doesn't work in silent mode", let me tell you the facts (i.e. what I did and what I experienced), rather than telling you what I think it means.

Start with bare machine

Run my setup with no switches. Choose to install main app component but not "Training Documents". Pick up a copy of SetupChoices.txt from Target Dir. It reads as follows:
-------------------------------
MYAH-PREDEF-COMPONENT
Best Authority Application
Training Documents
$
TRUE
TRUE
FALSE
$
$
C:\\Program Files\\\\Levit & James, Inc\\Best Authority
TRUE
Best Authority

MYAH64WOW
Win32
-------------------------------

Uninstall. Copy SetupChoices.txt into folder with Setup.exe (uncompressed version.) Run Setup /s. This run results in creation of a Training Docs folder, with all contents.

Uninstall. Run Setup without any switches. This run shows main Application component selected, but Training Documents de-selected. Cancel setup.

Edit SetupChoices.txt. Change 7th line from FALSE to TRUE. Run Setup without any switches. This run shows all components selected.
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 10, 2006 11:53 am

Hi Fletcher,

The attachment didn't make it...could you try again?

Also, could you please read this whitepaper, it will answer all your questions regarding MSI scripting:
http://www.installaware.com/installawar ... taller.pdf
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 1:00 pm

Attachment (this time, I'll check it as soon as I post.)
Fletcher James

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 1:05 pm

Trying again, this time without any spaces in path or filename
Fletcher James

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 1:14 pm

Michael:

I just cannot get this file to attach. I type the name of the file, and then click either Submit or Preview; or, I type the name of the folder it's in, then click Browse; highlight the filename; double-click; and THEN click preview or submit. In no case does the file get successfully attached.

It's just a 2.5 MB .zip file.
Fletcher James

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 10, 2006 1:57 pm

Hi Fletcher!

Thanks for your email. I think the problem is, when setup is running silently, its doing a Complete setup, since that's the default setup type. So the problem is not your feature selections being loaded correctly...the problem is that they are being replaced further down in your script during this code block:

Code: Select all

Comment: TO-DO: Customize your minimum setup here
if Variable MINIMUM Equals TRUE
  Deselect Component: Training Documents
  else
  if Variable COMPLETE Equals TRUE
    Select Component: Best Authority Application
    Select Component: Training Documents
  end
end


You can try skipping this part of the code when setup is running silently, for example.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

fletcherjames
Posts: 32
Joined: Mon Mar 13, 2006 3:36 pm
Location: Leesburg, VA
Contact:

Postby fletcherjames » Mon Jul 10, 2006 3:20 pm

I read your whitepaper -- it was helpful. I think I skimmed it once while evaluating IA, but it didn't make as much sense "in theory" as it does now that I've got hands-on experience. It confirmed what I thought about the Save Feature Selections. I simply moved that statement to just after the ApplyInstall, and it worked.

As to the Silent Mode load: Is it really the case that Save Feature Selections saves the Component Selected states, and it saves $TARGETDIR$, but doesn't save the Setup Type variables???

It seems to me that either:

a) the Save statement was meant for some different usage, and I'll need to figure out how to get it to do what I need, or

b) I'm the first person trying to really use this, and I've discovered an oversight in the design.

In any case, I think I got things working by adding a bit of code around the Load statement, as follows:

Find All Files in path $COLOPATH$\\SetupChoices.txt, write result into variable CHOICESFILENAME

if Variable CHOICESFILENAME not Equals
Set Variable PERSONALIZED to TRUE
Set Variable COMPLETE to FALSE
Load Feature Selections from file $COLOPATH$\\SetupChoices.txt
end

Unless you hear from me otherwise, I think you can consider this issue closed.

Thanks!
Fletcher James


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 174 guests