Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Problems Replacing Lines in File (http://forums.winamp.com/showthread.php?t=251162)

Joudoki 15th July 2006 16:16

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.

Afrow UK 15th July 2006 17:35

Use ConfigWrite from the NSIS documentation. It's under Useful Headers.

-Stu

Joudoki 15th July 2006 17:38

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.

Afrow UK 15th July 2006 17:40

Have a look at Examples\InstallOpions\testnotify.nsi

-Stu

Joudoki 15th July 2006 17:41

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.

Afrow UK 15th July 2006 20:08

This is probably better for what you need then:
http://nsis.sourceforge.net/Replace_...ecified_string

-Stu


All times are GMT. The time now is 05:56.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.