Edit INI file with command line variables

Got a problem you cannot solve? Try here.
NeeeeB
Posts: 12
Joined: Mon May 17, 2021 2:32 am

Edit INI file with command line variables

Postby NeeeeB » Mon May 17, 2021 4:58 am

I've been trying all the morning to edit an INI file based on command line variables, without success...
May I request a bit of help with this ?

First, this is the command line I execute from PowerShell :
.\Diane.exe USERNAME=someUsername DATABASE=someDB SERVER=someServer DRIVERID=someDriver

this is how I declare my variables in the script :
Image

and this is what I do at the end of the script :
Image

Installation performs without any error, but in the end, my .ini file is not updated with any of the variable values, as you can see in this screenshot...
Image

Any help with this would be greatly appreciated.
This is mandatory for our company to buy an InstallAware license.

Thanks.

PS: is it possible to "create" a section in the INI file ?
I mean, what if "DianeDB" does not exist in the INI file ? will it be created if I try to write a key to this section ?

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Edit INI file with command line variables

Postby FrancescoT » Mon May 17, 2021 12:17 pm

"Edit INI file" is a Windows Installer command (PURPLE COMMAND).
If your setup is based on Windows Installer Engine, PURPLE COMMANDS are not executed immediately but deferred to Apply Install execution.
https://www.installaware.com/forums/viewtopic.php?f=2&t=10848&p=41530

If you forcebly need to invoke your "Edit INI File" commands post Apply install execution, in your script simply include such commands within an IA Native Engine ON/OFF sequence.

For example:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Edit INI File ....
Edit INI File ....
Edit INI File ....
Set Variable NATIVE_ENGINE to FALSE 

https://www.installaware.com/forums/viewtopic.php?f=2&t=10499
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Baidu [Spider] and 54 guests