Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 9 Jun 2005 09:13:38 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Systemtechnik cc: cygwin AT cygwin DOT com Subject: Re: Directory c:\%USERPROFILE% created In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 9 Jun 2005, Systemtechnik wrote: > Hello, > > i was wandering about strange folders created in the root directory of > my Cygwin-Enhanced PCs and found out that everytime i start installer > programs from within a cygwin shell, a folder called %USERPROFILE% is > created in the base directory of the pc's harddisk. > > I found out that if i start a command-shell from windows there is an > environment variable called "%USERPROFILE%" which points to the current > logged in users directory. In cygwin-shells this variable is missing. > > So everytime a windows-process tries to access the current users > profile-dir (to store some ini's or whatever), the variable does not > resolve but will be taken literal, so this directory will be created. > In other words: %USERPROFILE% does not point to > "c:\WINNT\Profiles\username", resp. "%SystemRoot%\Profiles\username" > like it should. The effect is that the installer will fail, which is > very bad if running "silent" setups. > > To avoid this i've set $USERPROFILE to the appropriate profile-directory > for the users in his .profile in cygwin's /home/username. > This seems to work, but do i make something wrong ? Is there a better > way to do this ? > Are there any environment-variables or programs to resolve the current > users Windows-Profile-Directory, instead of setting it literally in > .profile ? Since you didn't attach the output of "cygcheck -svr" as requested in , this is just a guess. Your problem isn't with %USERPROFILE% per se, it's with some other variable (usually %HOME%) that contains "%USERFPROFILE%" in it. The environment is stored in the registry, and there is a special REG_EXPAND_SZ value type that causes any embedded variable references to be expanded when referenced. Variables that refer to other variables usually have that value type. Some buggy installation programs change the type of that value to REG_SZ (a regular non-expandable string), and therefore, when the value is read, the string "%USERPROFILE%" remains a literal string (i.e., isn't expanded). You need to look through your environment and see what variables contain the string %USERPROFILE%. You then need to go to the environment key in the registry, rename the values that have wrong types, and re-create them with the correct REG_EXPAND_SZ type. This isn't a Cygwin problem, but rather one exposed by Cygwin, since it uses the values of the variables to find out which path to use for $HOME (and creates that directory). HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "The Sun will pass between the Earth and the Moon tonight for a total Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/