Page 1 of 1

Editing INI-Files

Posted: Wed Jan 06, 2010 10:28 am
by Raubi
Hi,

I'm using the InstallAware 9 Trial for now, but I think, I'm going to buy it, if I can solve this problem:

At first, I searched for this problem and found two other threads hereand here

I understand the logic that I have to set my "edit ini file" commands before the command "Apply Install"

At first, the script installs a file called "ro.ini" which holds per default:
Ro.ini wrote:[Units]
Power=0
Capacity=0
Temperatur=0
Volumenstrom=0
Länge=0
Masse=0
Druck=0
LA=0
Wassermenge=0
Druckverlust=0
[Options]
Language=0
Build=0
As the setup and the installed application ships with five different languages, I want to set up the application's language to the one the user chose during the installprocess.

To do that, I wrote this script:

Code: Select all

  Install Files F:\\Dokumente\\Projekte\\Roller\\Installer\\Files\\Ro.ini to $TARGETDIR$
  Comment: Ini-Datei mit der Sprachwahl schreiben
  if Variable LANGUAGE Equals (Ignore Case) german
    Edit INI File $TARGETDIR$\\Ro.ini, [Options] Language=0
    else
    if Variable LANGUAGE Equals (Ignore Case) english
      Edit INI File $TARGETDIR$\\Ro.ini, [Options] Language=1
      else
      if Variable LANGUAGE Equals (Ignore Case) spanish
        Edit INI File $TARGETDIR$\\Ro.ini, [Options] Language=2
        else
        if Variable LANGUAGE Equals (Ignore Case) Italian
          Edit INI File $TARGETDIR$\\Ro.ini, [Options] Language=3
          if Variable LANGUAGE Equals (Ignore Case) french
            Edit INI File $TARGETDIR$\\Ro.ini, [Options] Language=4
          end
        end
      end
    end
  end

  if Variable ADVERTISE Equals TRUE
    Apply Advertised (get result into variable SUCCESS)
    else
    Create Folder $TARGETDIR$\\db
    Create Folder $TARGETDIR$\\drawings
    Create Folder $TARGETDIR$\\forms
    Create Folder $TARGETDIR$\\help
    Create Folder $TARGETDIR$\\language
    Create Folder $TARGETDIR$\\pictures
    Apply Install (get result into variable SUCCESS)
    if Variable SUCCESS not Equals ERROR
      if Variable SUCCESS not Equals CANCEL
      end
    end
  end
If I step through with the debugger it jumps to the right "edit ini file" command depending on the language. But it does NOT apply the changes I want to do.

Can anyone help me with this problem?

I'm slowly getting crazy about this :-)

Posted: Wed Jan 06, 2010 3:49 pm
by neillans
I might be barking up the wrong tree, but I'm almost 100% sure that you will need to put the Edit INI commands AFTER Apply Install as they are native MSI Code commands (i.e. not something executed by the MSI engine).