Edit INI file - write fails

Got a problem you cannot solve? Try here.
jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Edit INI file - write fails

Postby jweksej » Thu Nov 30, 2006 11:29 am

It simply doesn't work...
Reading goes ok, when writing is ignored. File access rights are ok, written values are ok, no idea what is the reason...

Edit INI File $TARGETDIR$\\defaultSettings\\JStationrc, [Database] Asset DB Host=$DB_SERVER$

Eny idea?

regards
Jarek

epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Postby epohl » Thu Nov 30, 2006 1:42 pm

I'm doing something very similar, also without success:

Edit INI File $TARGETDIR$\\Dialog.ini, [General] Database=$INIDATABASELINE$

I have tried it both with and without an existing .ini file, and although the install appears successful the .ini file is not modified.

Thanks,

Eric

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

Postby MichaelNesmith » Thu Nov 30, 2006 3:47 pm

Are you checking for whether this works or not after Apply Install?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Thu Nov 30, 2006 4:09 pm

I need to read ini file before installation and modify it after install. So I attached this file twice - to Creatives, for reading before and to Files for modification after install. I'm modifying this file after 'Apply Install' just before Finish.

One question about INI files - what will happen if I repeat the section on file begining (so it will be defined twice). Which definition will be ignored? First or second? I think about using 'Write to file' command.

regards
Jarek

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

Postby MichaelNesmith » Fri Dec 01, 2006 9:08 am

You will need to call Apply Install again - there was a very similar post in this forum, that explains the logic behind this (the post was about registry entries not being created) - please try to find that one.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

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

epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Postby epohl » Fri Dec 01, 2006 2:29 pm

In my case, I was definitely calling it after Apply Patch. Everything is after the "TO-DO: Insert any additional install commands here" comment, in the "else" part of the If Variable BUILDMODE Equals PATCH statement.

In my case I was able to work around it using "Write to Text File", but it is still worrisome.

Eric

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

Postby MichaelNesmith » Fri Dec 01, 2006 4:27 pm

Eric, reading this whitepaper will assuage your worries: www.installaware.com/msicode_scripting_technology.pdf
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

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

epohl
Posts: 35
Joined: Tue Nov 28, 2006 10:18 am

Postby epohl » Tue Dec 05, 2006 1:24 pm

Michael, thank you for the additional info. Placing MSI commands before Apply Install does indeed work.

An additional, related question: does it matter where non-MSI commands go? Should they specifically go after "Apply Install", for example? If placed before Apply Install, does InstallAware automatically pull them out and execute them outside the MSI?

Thanks,

Eric

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

Postby MichaelNesmith » Tue Dec 05, 2006 3:52 pm

For full answers to these questions, please read:
www.installaware.com/msicode_scripting_technology.pdf

This will be well worth your investment in time if you will be working with InstallAware in any serious capacity.

The short answers to your question is: It does matter where non-MSI commands go - they execute immediately. So in some cases you want to place them before Apply Install, in other cases after Apply Install. All depends on your setup logic. The same goes for MSI commands too, actually. You can call Apply Install multiple times, for instance, if you need to.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 33 guests