Thread: Path
View Single Post
Old 11th October 2011, 22:03   #8
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Quote:
Originally Posted by sethradio View Post
I will only use this if I am writing a command line tool. This allows users of a program to not have to type the full path to the executable.
You should at least ask the user whether he wants your tool to be added to his PATH.

As an alternative you can add a shortcut to the Startmenu that opens a console with your tool added to the PATH, instead of adding your tool to the PATH globally. Many applications, like Visual Studio or GIT, use this technique.

The command for the Startmenu shortcut could be something like:
%comspec% /k ""$INSTDIR\setpath.bat""

And the "setpath.bat" could be created on-the-fly by the installer and should look like:
code:
@echo off
echo Setting up environment for Super Duper Tool...
set "PATH=C:\Path To Your Tool;%PATH%"


My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote