Page 1 of 1

Write into Text File Problem

Posted: Wed Feb 15, 2006 2:08 am
by nbmkumar
Hi,
We are using InstallAware Studio for creating Web Installer. In the Installer we need to add the user name and password in one of the config files in IIS. for that i tried to use the command Write into Text File. but i cannot see any change in the target file after installation.

my code looks like this:

[DEFINE REGION: Perform First Time or Maintenance Installation]
// Install/Re-Install product
Create Shortcut $SHORTCUTFOLDER$\\Uninstall ictm to $UNINSTALLLINK$
[OFFLINE CONTENT]
Install Files E:\\admin\\files\\ictm\\*.* to $TARGETDIR$\\ictm
Install Files E:\\admin\\files\\soft\\*.* to $TARGETDIR$\\ictm\\soft
Write into Text File $TARGETFIR$\\web.config from Value <configuration> (at start of file)
[DEFINE WEB MEDIA ictm]

I removed the file web.config from the installation and tried. The document says that it will create the file if the file doesnt exists. but it doesnt creating the file too.

And also i dont understand the text in the help that says
"This command does NOT execute through Windows Installer and is provided as a convenience to the setup author."

Does this means that Write into Text File is not a windows installer command?

Muthu

Posted: Wed Feb 15, 2006 8:42 am
by Gizm0
Hello,

You should apply the command on the Apply Installation section, not before or after it..

Thank you,

Posted: Wed Feb 15, 2006 11:46 am
by MichaelNesmith
Hi Kumar,

This is a very good question. Purple commands in the setup script (with default highlighting) are Windows Installer commands. You can think as if they are "cached" until Apply Install executes, then the "cache" is "flushed" as the MSI engine is invoked and performs all pending changes.

Black commands, on the other hand, execute immediately and they are handled by InstallAware. For instance the Write to Text File command does something which is not available at all through the MSI engine - Microsoft simply left it out. Therefore, InstallAware provides it as a convenience for you, in the form of a script command that executes right away.

So all you have to do is call the command after Apply Install executes. The reason it appears to not execute is probably because it modified a file that doesn't even exist yet, and which later got overwritten by the Install Files command that worked when Apply Install got called.

Posted: Thu Feb 16, 2006 3:33 am
by nbmkumar
Thanks for ur help.
I works Perfect. Why dont u add these details in the documentation or is it already there and i didnt go thro fully?

Muthukumaran.

Posted: Thu Feb 16, 2006 6:03 am
by MichaelNesmith
Hi Muthukumaran,

Yes, its already available in the help. If you press F1 while the commands section of the script editor is highlighted (the region displaying all available commands to the left of your setup script), a help topic titled "Classes of Commands" shows - you may also look this up in the help index for more information.