Page 1 of 1

Edit INI File Error

Posted: Fri Jan 06, 2017 4:30 am
by SebSpiers
Hi,

I'm trying to edit an INI file using the Edit INI File function.

Unfortunately I am getting this error, which I am seeing often across various features (#frustrating).

Image

The code I'm using is as following and looks to be correct in terms of use having looked at the documentation:

Code: Select all

Edit INI File C:\eWAM\ini\init.ini, [Project] IsLDAPUsed=$LDAP$


The INI file is also correctly formatted.

Any ideas?

Re: Edit INI File Error

Posted: Mon Jan 09, 2017 10:41 am
by FrancescoT
Dear SebSpiers,

without knowing which is the exact context where you are trying to use the command, it's quite impossible to say which is the cause of your issue.

For what concerns the "Edit INI File" command specifically, please consider that this is a Windows Installer Command (PURPLE COMMANDS). The execution of any Windows Installer command, it's by default deferred to "Apply Install" execution. For example, you may have sequenced "incorrectly" the command in your script logic.

If you have any chance to post a a very "VERY" minimal project that replicates the issue, I'll try to have a look.

Regards

Re: Edit INI File Error

Posted: Mon Jan 09, 2017 11:53 am
by SebSpiers
So I cannot execute this anywhere within my script? It must be at a certain point during the script?

Re: Edit INI File Error

Posted: Mon Jan 09, 2017 1:33 pm
by FrancescoT
Dear SebSpiers,

as I have already said, if the setup is based on Windows Installer Engine, PURPLE COMMANDS are not executed immediately but deferred to Apply Install. This is not due an IA limitation ...it's the Windows Installer Engine that works in this way.

So this means that you can use the "Edit INI File" command at any time in your script, but the INI file will be modified only once the Apply Install statement gets executed.

Finally and if you want to execute the command immediately, you may take advantage of the built-in InstallAware Native Engine.
This specific argument has been widely discussed on our forum. At any rate, please have a look at the following link.
https://www.installaware.com/forums/viewtopic.php?f=2&t=10499&hilit=Set+Variable+NATIVE_ENGINE+to+TRUE

Regards

Re: Edit INI File Error

Posted: Tue Jan 10, 2017 6:43 am
by SebSpiers
FrancescoT wrote:if the setup is based on Windows Installer Engine, PURPLE COMMANDS are not executed immediately but deferred to Apply Install. This is not due an IA limitation ...it's the Windows Installer Engine that works in this way.

So this means that you can use the "Edit INI File" command at any time in your script, but the INI file will be modified only once the Apply Install statement gets executed.


OK, so this doesn't explain the errors I've been getting, which is both a good thing and a bad thing I guess.

I'm going to try my project on another machine shortly, to see if the cause of my problem is machine specific, especially as it seems to be recurring with different functions.

Thanks for your help.