Editing INI-Files

Got a problem you cannot solve? Try here.
Raubi
Posts: 14
Joined: Wed Jan 06, 2010 10:09 am
Location: Germany
Contact:

Editing INI-Files

Postby Raubi » Wed Jan 06, 2010 10:28 am

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 :-)

neillans
Posts: 536
Joined: Sat Nov 04, 2006 6:21 am
Location: Scottish Borders, UK
Contact:

Postby neillans » Wed Jan 06, 2010 3:49 pm

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).
Andy Neillans


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 55 guests