Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 23rd June 2003, 15:25   #1
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
Path Manipulation - square box character?

This is in reference to the path manipulation functions here:
http://nsis.sourceforge.net/archive...e.php?pageid=91

I am using the path manipulation functions mentioned above. On Win9x based machines the functions add a path to the end of autoexec.bat (SET PATH=%PATH%;mydir). But on some machines there is a weird square character just above the SET PATH line. I am not positive what this square character is, but SET PATH never gets executed. Any ideas?
SprinklerHead is offline   Reply With Quote
Old 23rd June 2003, 15:26   #2
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
Try that link again...

http://nsis.sourceforge.net/archive/....php?pageid=91
SprinklerHead is offline   Reply With Quote
Old 25th June 2003, 11:56   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Does that square character appear after the line too? Can you please attach the autoexec.bat file? What version of Windows have you tested it on?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th June 2003, 13:01   #4
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
The square character does not occur after the line, only just before it. This occurred on several Windows 98 machines. I have tested on all versions of Windows. It seems to only occur on some Windows 98 machines.

My guess is that the square box character is an end of file character or a non-printable character. My gut feeling is that some autoexec.bat files have this character and some don't. That would explain why it only occurs on some Windows 98 boxes, not all.

I fixed the machine here in the office that had this problem already, so I no longer have an autoexec.bat to send you. If another user reports the problem (one called last week but I told him how to fix), I will get them to email it to me and I will post it here.
SprinklerHead is offline   Reply With Quote
Old 25th June 2003, 14:32   #5
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
Here is an example autoexec.bat file.
Attached Files
File Type: zip autoexec1.zip (191 Bytes, 65 views)
SprinklerHead is offline   Reply With Quote
Old 25th June 2003, 21:25   #6
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 569
As you suspected, in the cases where things go wrong there is an end-of-file character at the end of the file to which you are adding the path. In your ZIP file, the first line ends with ASCII codes 13, 10, 26 (the normal sequence at the end of a line is ASCII 13, 10).

One solution would be check that the file does not end with ASCII code 26 before you append the new data.

The thread at http://forums.winamp.com/showthread.php?threadid=130099 may give you some ideas of how to go about this.
pengyou is offline   Reply With Quote
Old 27th June 2003, 19:15   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Yey for DOS

On my todo.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 17th July 2003, 17:33   #8
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
I wrote a Delphi dll that can add a path to any 95 or NT based platform.

It handles the square box character problem described above by searching for the ASCII character #26 on a line by itself and deleting that line if found.

It also checks to see if the path you are adding is already in the system path. If it is, then it doesn't add it. This could save the user a reboot on 95 platforms. For NT based platforms, it automatically calls SendMessage - you don't have to call that in your install script.

For 95 based platforms, autoexec.bat gets modified. For NT platforms, the Path data in the key HKLM\System\CurrentControlSet\Control\Session Manager\Environment\ gets modified.

To add a path:
code:
Path::AddToPath $INSTDIR
Pop $0 ;<--- will be either "Reboot" or "NoReboot"



To remove a path:
code:
Path::RemoveFromPath $INSTDIR
Pop $0 ;<--- will be either "Reboot" or "NoReboot"



The path must exist prior to a call to AddToPath or RemoveFromPath (GetShortPathName doesn't work right unless the Path exists).

After this lengthy post the forum won't allow me to post the zip file because it's too big! Well, if someone wants it I can email it to you.
SprinklerHead is offline   Reply With Quote
Old 17th July 2003, 19:18   #9
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Please create an archive page for your plug-in and mail the plug-in to one of the admins.
Joost Verburg is offline   Reply With Quote
Old 18th July 2003, 17:49   #10
SprinklerHead
Junior Member
 
Join Date: Sep 2002
Location: Charleston, SC
Posts: 42
Err, what's an archive page?
SprinklerHead is offline   Reply With Quote
Old 18th July 2003, 17:56   #11
YtseJam
Forum King
 
YtseJam's Avatar
 
Join Date: Dec 2000
Location: Israel
Posts: 2,399
Send a message via ICQ to YtseJam Send a message via AIM to YtseJam
http://nsis.sourceforge.net/archive

YtseJam is offline   Reply With Quote
Old 29th November 2003, 16:34   #12
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Finally fixed.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp 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