You are here

Edit .dat file with NSIS?

9 posts / 0 new
Last post
Devo
Offline
Last seen: 1 year 3 months ago
Joined: 2007-09-04 14:55
Edit .dat file with NSIS?

I'm working on improving the Winamp launcher, really the only thing left to do is make the media library portable. The issue is that the media library uses absolute paths and is stored in a .dat file. Is there a way in NSIS to find B:, C:, E: or whatever the path may be and replace it with the drive letter of the flash drive? I know you can do a find and replace, but will this work in a .dat file? Also, since the initial drive letter of the path can be anything, how would I do the find and replace for it? Thanks.

ZachHudock
ZachHudock's picture
Offline
Last seen: 2 years 1 month ago
Developer
Joined: 2006-12-06 18:07
check out the ReplaceInFile

check out the ReplaceInFile code used in the Notepad++ launcher.

The developer formerly known as ZGitRDun8705

wraithdu
Offline
Last seen: 11 years 7 months ago
Developer
Joined: 2007-06-27 20:22
The answer is yes, as long

The answer is yes, as long as the .dat file is plaintext (you can read it in notepad) and it's not unicode.

Devo
Offline
Last seen: 1 year 3 months ago
Joined: 2007-09-04 14:55
It's unicode, I can open it

It's unicode, I can open it in notepad, but it looks all messed up. So am I completely screwed?

John Bentley
John Bentley's picture
Offline
Last seen: 15 years 5 months ago
Developer
Joined: 2006-01-24 13:26
I know AutoIt supports

I know AutoIt supports unicode. If the NSIS plugin doesn't work use AI.

cowsay Moo
cowthink 'Dude, why are you staring at me.'

John T. Haller
John T. Haller's picture
Offline
Last seen: 1 hour 39 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Rather Not

I'd rather not base any launchers around AutoIT. AutoIT has far more false positives than NSIS (it's used to develop quite a few bits of malware). And, as closed source freeware, it's the riskiest kind of software to base things on as the authors can just stop developing it anytime and you're screwed.

If you need some of the features of AutoIT for a launcher you're much better off using AutoHotKey.

Sometimes, the impossible can become possible, if you're awesome!

John Bentley
John Bentley's picture
Offline
Last seen: 15 years 5 months ago
Developer
Joined: 2006-01-24 13:26
AFAICS AutoHotKey doesn't

AFAICS AutoHotKey doesn't support unicode.

cowsay Moo
cowthink 'Dude, why are you staring at me.'

Jimbo
Offline
Last seen: 5 years 1 week ago
Joined: 2007-12-17 05:43
Backing up a little...

There seems to have been a slight misunderstanding further up the thread

The OP asked "can NSIS change letters in a binary file"

One of the answers given was that it could handle the files if they were plain text, but not unicode, with details of using notepad to see which they are.

However, Winamp .dat files are binary data. They are not any form of text: ascii, unicode or otherwise.

Having just inspected one, I can confirm that the file pathnames are embedded within it in plain 8-bit ascii, so if any of the processing languages can search and replace bytes in an arbitrary data stream, it should be doable.

Anyone know?

Devo
Offline
Last seen: 1 year 3 months ago
Joined: 2007-09-04 14:55
I went and asked on the

I went and asked on the Winamp forums about editing the library and I got this response.

Log in or register to post comments