On Wed, 7 Feb 2007 09:40:32 -0600, [EMAIL PROTECTED]
wrote:

>When I compile an executable using perlapp (Version 6.0.0, build 117102), 
>it seems to have a problem running on an XP machine that a. doesn't have 
>Perl installed on it, and b. doesn't have the directory C:\Temp.  Here's 
>the error message:
>
>mkdir <"C:\Temp\pdk-Secuser\"> failed, errno=2
>Panic:  Can't find temp dir for perlapp
>
>where "Secuser" is the logged in user (i.e.: the directory it's trying to 
>create is C:\Temp\pdk-<username>). Is this a problem with executables 
>compiled to be freestanding (i.e.: to run on PCs that don't have Perl 
>installed)? 

Executables generated by PerlApp use the Windows GetTempPath() API to
determine the location of the TEMP directory:

    http://msdn2.microsoft.com/en-us/library/aa364992.aspx

| Remarks
| 
| The GetTempPath function checks for the existence of environment variables
| in the following order and uses the first path found:
| 
|    1. The path specified by the TMP environment variable.
|    2. The path specified by the TEMP environment variable.
|    3. The path specified by the USERPROFILE environment variable.
|    4. The Windows directory.

This means if you have TMP set to point to C:\Temp, but don't actually
have that directory, then the application will show the error you see
above.

In some way I would claim that you have a misconfigured Windows system,
but I guess PerlApp should also try harder, and just create "C:\Temp" if
it doesn't exist.  But that could still fail if you set TMP to "X:\Temp"
and you don't have an X: drive.

Maybe the best strategy is to check the 4 locations GetTempPath() would
try ourselves, and use the first one that already exists.

This could still fail if the user unsets USERPROFILE and doesn't have
write access to the Windows directory, but I think it is valid to abort
in that situation.

Cheers,
-Jan

PS: Please discuss PerlApp specific problems on the PDK mailing list.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to