Re: ImageMagick messes up PATH
Zlatko Lovcevic <[email protected]> Wed, 10 Jun 2009 16:48:17 +0200
| Newsgroups | gmane.comp.video.image-magick.bugs |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: >> adding your own code for appending to Path >> > > We're primarily Linux developers meaning anything Windows gets done but at > a snails pace. Do you have code that correctly implements the > functionality of the PathTool.exe utility? > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4143 (20090610) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > Since you are using InnoSetup you could use this in [Code] section: [Code] procedure CurStepChanged(CurStep: TSetupStep); var sPath: string; begin case CurStep of ssPostInstall: begin sPath := GetEnv <topic_isxfunc_getenv.htm>('Path'); sPath := sPath + ';' + ExpandConstant('{app}'); RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', sPath); end; end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); var sPath: string; begin case CurUninstallStep of usPostUninstall: begin sPath := GetEnv <topic_isxfunc_getenv.htm>('Path'); Delete(sPath, Pos(';' + ExpandConstant('{app}')), Length(';' + ExpandConstant('{app}')); RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', sPath); end; end; I haven't had time to check this code so you will have to do it yourself.