Page 1 of 1

Edit ini file during update

Posted: Thu Sep 23, 2010 10:01 am
by Raubi
Hi,

is it possible to update an ini file during an update?

I use the normal updates.mia which is provided by IA. Just did a few changes.

With this code I want to update the ini:

Code: Select all

[DEFINE REGION: Download and Install Updates]
label: Check for Updates
Set Variable UPDATE_GET_INI to 
Download File #UPDATE_SERVER# into $SUPPORTDIR$\updates.ini (get result into variable UPDATE_GET_INI)
Edit INI File $MYAPPDATA$\SoftwareName\Ro.ini, [Update] LastUpdateCheck=$DATE$
Apply Install
If I try it this way, I get the message:

Code: Select all

---------------------------
SoftwareName
---------------------------
Error

The given path $MYAPPDATA$\SoftwareName is not available.
---------------------------
OK   
---------------------------

I want to update the ini file even if the user decided not to install new updates.

Is it possible within built in functions or do I have to write a plugin for it?

Thanks for help

Re: Edit ini file during update

Posted: Fri Sep 24, 2010 3:19 pm
by mills
What is $MYAPPDATA$ pointing to?

Re: Edit ini file during update

Posted: Mon Sep 27, 2010 3:45 am
by Raubi
Hi,

i found the problem. MYAPPDATA was not defined in updater context. But with the "Apply Install" the installer does more than just updating the ini file. So I wrote a little plugin doing the job.