Stuart McLachlan
stuart at lexacorp.com.pg
Sun Jan 23 16:48:31 CST 2005
On 23 Jan 2005 at 16:40, Reuben Cummings wrote: > > 3 The Windows system directory. > > I think this is the most reasonable location to place the dll as I will be > adding this feature to all my apps. > > My question then becomes how do I always get it installed to the proper > folder. It's concievable, highly unlikely, but concievable, that the system > folder is named differently than one would suspect. For example, I expect > ...\system32, but who's to say someone hasn't changed it? Is that even > possible? Am I over thinking this or is it a real concern. > > I just need a way to always get this dll to the system folder and I'm done > with this project. > You can check for the Environment variables SystemRoot and Windir or: 1. Use an installer than determines system directories. As an example, to use the HJInstal (http://www.freebyte.com/hjinstall) application mentioned the other day "If you want to copy files into the Windows directory use the syntax <copy files -WinDir> To copy files into the system directory use <copy files -SystemDir>" 2. Read the Registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot 3. Roll your own routine using the GetSystemDirectory or GetWindowsDirectory API calls -- Stuart