Home | History | Annotate | Download | only in Windows

Lines Matching full:path

53 // Article 44 - Native ISX procedures for PATH modification
63 pmAddToBeginning = $1; // Add dir to beginning of Path
64 pmAddToEnd = $2; // Add dir to end of Path
65 pmAddAllways = $4; // Add also if specified dir is already included in existing path
67 pmRemove = $10; // Remove dir from path
68 pmRemoveSubdirsAlso = $20; // Remove dir and all subdirs from path
71 psCurrentUser = 1; // Modify path for current user
72 psAllUsers = 2; // Modify path for all users
78 mpBothAddAndRemove = -3; // User has specified that dir should both be removed from and added to path
81 { Helper procedure: Split a path environment variable into individual dirnames }
82 procedure SplitPath(Path: string; var Dirs: TStringList);
90 while (pos<=Length(Path)) do
92 if (Path[pos]<>';') then
93 s := s + Path[pos];
94 if ((Path[pos]=';') or (pos=Length(Path))) then
108 { Helper procedure: Concatenate individual dirnames into a path environment variable }
109 procedure ConcatPath(Dirs: TStringList; Quotes: boolean; var Path: string);
115 Path := '';
121 Path := Path + s;
123 Path := Path + ';'
128 { Helper function: Modifies path environment string }
143 // Split old path in individual directory names
146 // Check if dir is allready in path
154 // Should dir be removed from existing Path?
166 // Should dir be added to existing Path?
169 // Add dir to path
172 // Dir is not in path allready or should be added anyway
184 // Concatenate directory names into one single path variable
191 { Helper function: Modify path on Windows 9x }
210 // Read existing path
218 // Check if line starts with "PATH=" after first stripping spaces and other "fill-chars"
226 if (Pos('PATH=', uppercase(ActualLine))=1) or (Pos('SETPATH=', uppercase(ActualLine))=1) then
228 // Remove 'PATH=' and add path to "OldPath" variable
230 // Check if an earlier PATH variable is referenced, but there has been no previous PATH defined in Autoexec
231 if (pos('%PATH%',uppercase(ActualLine))>0) and (PathLineNos.Count=0) then
233 if (pos('%PATH%',uppercase(ActualLine))>0) then
235 ActualLine := Copy(ActualLine, 1, pos('%PATH%',uppercase(ActualLine))-1) +
237 Copy(ActualLine, pos('%PATH%',uppercase(ActualLine))+6, Length(ActualLine));
241 // Update list of line numbers holding path variables
247 // Save first line number in Autoexec.bat which modifies path environment variable
253 // Modify path
256 // Write Modified path back to Autoexec.bat
257 // First delete all existing path references from Autoexec.bat
264 // Then insert new path variable into Autoexec.bat
265 AutoexecLines.Insert(FirstPathLineNo, '@PATH='+ResultPath);
280 { Helper function: Modify path on Windows NT, 2000 and XP }
298 RegValueName := 'Path';
304 RegValueName := 'Path';
308 // Read current path value from registry
316 // Modify path
319 // Write new path value to registry
329 { Main function: Modify path }
330 function ModifyPath(Path: string; Method, Scope: integer): integer;
340 Path := ExpandConstantEx(Path, ' ', ' ');
344 ModifyPath9x(Path, Method);
348 ModifyPathNT(Path, Method, Scope);