WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Search path functions
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

Search path functions

Hi!

I have written some functions for adding/removing directories from the search path of Windows. They work for NT (without restart) and 9x.

I will be happy to see them in the functions.html file or contrib folder so they can help others but me

KiCHiK

Attachment: path.zip
This has been downloaded 686 time(s).

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 03-01-2002 06:27 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
dbareis
Member

Registered: Apr 2001
From:

Hi,

Some (possibly only older editors) can put EOF characters into the file, in which case the approach you use will fail (as your "SET" would never get executed).

Just a warning,
Dennis

__________________
Dennis Bareis
dbareis@labyrinth.net.au

Heaps of free Windows, OS/2, Linux (and other) software/source at:
http://www.labyrinth.net.au/~dbareis/index.htm
Text Based NSIS WIZARD available from the PPWIZARD download page!

Quick Link | Report this post to a moderator | IP: Logged

dbareis is offline Old Post 03-02-2002 12:07 AM
Click Here to See the Profile for dbareis Click here to Send dbareis a Private Message Click Here to Email dbareis Visit dbareis's homepage! Find more posts by dbareis Add dbareis to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

Thanks Dennis!

After looking in the code again, I have found out that somehow some old code got into it. I have now attached the newest code from my installer script with (I hope) all of the corrections needed.

Please download this version instead of the earlier one.

About your comment, I don't really understand what you mean. Do these editors put EOF in the middle of the file? If so, how else can I seek for the EOF?

Attachment: path.zip
This has been downloaded 825 time(s).

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 03-02-2002 11:26 AM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
dbareis
Member

Registered: Apr 2001
From:

quote:
Originally posted by kichik


About your comment, I don't really understand what you mean. Do these editors put EOF in the middle of the file? If so, how else can I seek for the EOF?



In the good old days editors added a special EOF character (stupid but true) to files (the reason for the /A /B switches on a copy command), most (all?) programs (including Windows reading autoexec.bat etc) still stop reading at the EOF character.

From memory the EOF character was decimal 26, if I'm wrong then it was 27.

I don'y know how common this would be but I have seen this myself so I know it does happen (I tried to do exactly what your code does).

Bye,
Dennis

__________________
Dennis Bareis
dbareis@labyrinth.net.au

Heaps of free Windows, OS/2, Linux (and other) software/source at:
http://www.labyrinth.net.au/~dbareis/index.htm
Text Based NSIS WIZARD available from the PPWIZARD download page!

Quick Link | Report this post to a moderator | IP: Logged

dbareis is offline Old Post 03-02-2002 11:35 PM
Click Here to See the Profile for dbareis Click here to Send dbareis a Private Message Click Here to Email dbareis Visit dbareis's homepage! Find more posts by dbareis Add dbareis to your buddy list Edit/Delete Message Reply w/Quote
superrock
Member

Registered: Jan 2002
From: Graz, Austria

Post RefreshEnv

Hi,

Thanks for posting the path script. It would be helpful for me to get also the source for RefreshEnv or if you could explain what exactly it contains (Api call)

Greetings,
Andreas

Quick Link | Report this post to a moderator | IP: Logged

superrock is offline Old Post 03-03-2002 02:52 PM
Click Here to See the Profile for superrock Click here to Send superrock a Private Message Find more posts by superrock Add superrock to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

Here is the API function called:

DWORD dwReturnValue;
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) "Environment", SMTO_ABORTIFHUNG, 5000, &dwReturnValue);

KiCHiK

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 03-03-2002 08:44 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
superrock
Member

Registered: Jan 2002
From: Graz, Austria

RefreshEnv Api function

Thanks kichik,

Will implement the function in an exe.

Greetings,
Andreas

Quick Link | Report this post to a moderator | IP: Logged

superrock is offline Old Post 03-03-2002 11:08 PM
Click Here to See the Profile for superrock Click here to Send superrock a Private Message Find more posts by superrock Add superrock to your buddy list Edit/Delete Message Reply w/Quote
GGamer
Junior Member

Registered: Apr 2003
From:

Question

Kichik,

I have looked at your zip file and the archive example on sourgefourge. It is almost exactly what I am looking for. In both cases you change HKLU\Enviorment Path Key (which is for the logedon user). But in my case I want to append the path for all the users, HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\ Path key (As far as I know this is the right key). I have modified your code to change this key instead. It does append the path, but it seems to fix the %SystemRoot% to a string instead of a variable, eg (in dos)

Before addation:

path=c:\winnt\system\;c:\winnt\

After addition of c:\foo
path=%SystemRoot%;%SystemRoot%\system;c:\foo

Do you have any suggestions?

Thanks,

Ross

Quick Link | Report this post to a moderator | IP: Logged

GGamer is offline Old Post 04-18-2003 12:08 AM
Click Here to See the Profile for GGamer Click here to Send GGamer a Private Message Find more posts by GGamer Add GGamer to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

Use WriteRegExpandStr instead of WriteRegStr and it should keep the variables.

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 04-18-2003 12:17 AM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
GGamer
Junior Member

Registered: Apr 2003
From:

Thanks, works a treat!

Ross

Quick Link | Report this post to a moderator | IP: Logged

GGamer is offline Old Post 04-18-2003 09:53 PM
Click Here to See the Profile for GGamer Click here to Send GGamer a Private Message Find more posts by GGamer Add GGamer to your buddy list Edit/Delete Message Reply w/Quote
scarletbow
Junior Member

Registered: Dec 2003
From:

I am using Windows XP and when I uninstall everthing seems to work fine. When I check the path it looks ok, but when I try to type in commands that were accessible in my path I can't. Has anybody had this problem yet?

Quick Link | Report this post to a moderator | IP: Logged

scarletbow is offline Old Post 12-03-2003 06:19 PM
Click Here to See the Profile for scarletbow Click here to Send scarletbow a Private Message Click Here to Email scarletbow Find more posts by scarletbow Add scarletbow to your buddy list Edit/Delete Message Reply w/Quote
Brummelchen
Major Dude

Registered: May 2003
From:

Lately i used this function:
http://nsis.sourceforge.net/Path_Manipulation

But i had to set timeout=1000 otherwise my explorer will crash badly
(tried several installations/deinstallations with it)

PHP:

SendMessage
${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000



HTH

__________________
Greets, Brummelchen

Quick Link | Report this post to a moderator | IP: Logged

Brummelchen is offline Old Post 02-14-2007 12:25 PM
Click Here to See the Profile for Brummelchen Click here to Send Brummelchen a Private Message Find more posts by Brummelchen Add Brummelchen to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

If Explorer itself crashes, you probably have some rouge shell extension.

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 02-15-2007 07:51 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
Brummelchen
Major Dude

Registered: May 2003
From:

no - my system works fine. and the crash happend when opening START - Programs - <subfolder>, not anywhere else.
It exactly happend when i set timout=5000 and right after the (de-)installation (both concerned).
i can do vice versa many times without reboot...
BTW the system timeout here is set to 5000 instead windows default 20000 (all values in milli seconds).

it was this line which crashes my explorer (explorer + task bar/desktop).
It was added to the script which works well.

__________________
Greets, Brummelchen

Quick Link | Report this post to a moderator | IP: Logged

Brummelchen is offline Old Post 02-18-2007 01:22 AM
Click Here to See the Profile for Brummelchen Click here to Send Brummelchen a Private Message Find more posts by Brummelchen Add Brummelchen to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

Fine, then it's not a rouge shell extension.

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 02-20-2007 08:11 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
Brummelchen
Major Dude

Registered: May 2003
From:

finally i will see when user is using the installer - but till
now no negative feedback (ok i build it in as an option). thx

__________________
Greets, Brummelchen

Quick Link | Report this post to a moderator | IP: Logged

Brummelchen is offline Old Post 02-21-2007 07:55 PM
Click Here to See the Profile for Brummelchen Click here to Send Brummelchen a Private Message Find more posts by Brummelchen Add Brummelchen to your buddy list Edit/Delete Message Reply w/Quote
didava
Member

Registered: May 2007
From:

trojan >> RefreshEnv.exe

Attachment: trojan.png
This has been downloaded 216 time(s).

Quick Link | Report this post to a moderator | IP: Logged

didava is offline Old Post 07-12-2007 10:04 AM
Click Here to See the Profile for didava Click here to Send didava a Private Message Click Here to Email didava Find more posts by didava Add didava to your buddy list Edit/Delete Message Reply w/Quote
kichik
M.I.A.
[NSIS Dev, Mod]

Registered: Oct 2001
From: Jerusalem, Israel

False positive. Anyway, the SendMessage solution is simpler.

__________________
NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius

Quick Link | Report this post to a moderator | IP: Logged

kichik is offline Old Post 07-12-2007 04:27 PM
Click Here to See the Profile for kichik Click here to Send kichik a Private Message Visit kichik's homepage! Find more posts by kichik Add kichik to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 09:40 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
WINAMP.COM | Forums : Powered by vBulletin version 2.3.9 WINAMP.COM | Forums > Developer Center > NSIS Discussion > Search path functions
Show Printable Version
 | 
Email this Page
 | 
Subscribe to this Thread

Forum Jump:
 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is off
vB code is ON
Smilies are ON
[IMG] code is ON