Old 15th July 2006, 16:16   #1
Joudoki
Junior Member
 
Join Date: Jun 2006
Location: Boulder, CO
Posts: 8
Send a message via AIM to Joudoki Send a message via Yahoo to Joudoki
Question Problems Replacing Lines in File

Ok, so I have this installer that installs a mod for a game, and you need to configure certain settings in this file to get it set up.

I'm using the function from the wiki:
http://nsis.sourceforge.net/Write_to...le_line_number

Now, the problem is, it's deleting the file!
Is there a better function to use? The file is already written when I install, and I'm going into the file and replacing certain lines with a different value depending on what the user said.

I know what the line number is that I need to replace, so I don't need a function to search - just to replace a whole line.

Last edited by Joudoki; 15th July 2006 at 16:33.
Joudoki is offline   Reply With Quote
Old 15th July 2006, 17:35   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use ConfigWrite from the NSIS documentation. It's under Useful Headers.

-Stu
Afrow UK is offline   Reply With Quote
Old 15th July 2006, 17:38   #3
Joudoki
Junior Member
 
Join Date: Jun 2006
Location: Boulder, CO
Posts: 8
Send a message via AIM to Joudoki Send a message via Yahoo to Joudoki
Ok, one other problem I need to enable/disable some text boxes depending on the state of a checkbox. Any way to do this? I did a search and I only came up with some old threads from years past.
Joudoki is offline   Reply With Quote
Old 15th July 2006, 17:40   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Have a look at Examples\InstallOpions\testnotify.nsi

-Stu
Afrow UK is offline   Reply With Quote
Old 15th July 2006, 17:41   #5
Joudoki
Junior Member
 
Join Date: Jun 2006
Location: Boulder, CO
Posts: 8
Send a message via AIM to Joudoki Send a message via Yahoo to Joudoki
Ah, that won't work, Afrow. Here's what my file looks like: (It's LUA)
code:

ECS_ADMINS_IMPORTULX = true; -- Import admins from ULX?
ECS_ADMINS_IMPORTMANI = false; -- Import admins from Mani?

ECS_ADMINS_ULX_REQACCESS_R = "NONE"; -- Required flag in ULX to be a restricted user. (Can't use it all)
ECS_ADMINS_ULX_REQACCESS_B = "r"; -- Required flag in ULX to be an advanced user
ECS_ADMINS_ULX_REQACCESS_A = "e"; -- Required flag in ULX to be an admin
ECS_ADMINS_ULX_REQACCESS_S = "a"; -- Required flag in ULX to be a super admin



Well, for example, I need to replace the first line with ECS_ADMINS_IMPORTULX = false; or ECS_ADMINS_IMPORTULX = true;, depending on what the user says.
Joudoki is offline   Reply With Quote
Old 15th July 2006, 20:08   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
This is probably better for what you need then:
http://nsis.sourceforge.net/Replace_...ecified_string

-Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump