delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/11/09/17:24:07

From: cjjohans AT cc DOT helsinki DOT fi (Carl J R Johansson)
Subject: Re: Default linker output filename
9 Nov 1996 17:24:07 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <Pine.OSF.3.91.961109231726.1690A-100000.cygnus.gnu-win32@vesuri.helsinki.fi>
Mime-Version: 1.0
X-Sender: cjjohans AT vesuri DOT helsinki DOT fi
Original-To: hhemken AT cell DOT cinvestav DOT mx
Original-cc: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

> However, if the system were able to mark something as executable, there
> wouldn't be any point in changing the extension to .exe. Worse, I think
> (?) the same is true for NT, an ostensibly *real* OS.
> 

I found that this _is_ actually possible with a small registry hack (on
W95). Just create a new key called '.out' (or whatever) under 
HKEY_CLASSES_ROOT and copy the values for .exe there (Default : 
'exefile', Content Type : 'application/x-msdownload').

I found that when I renamed DOS applications they wouldn't work (complained
about not finding the file), but that should be totally irrelevant to
gnu-win32. I also found that I could not run any of them from a DOS window, 
that maybe makes them already less useful for gnu-win32? Bash accepted them
though, and double-clicking (Explorer) worked. 

To get the 'executable' icon as well I had to create a separate key called
'UnixFile' (or whatever) and refer to it instead of 'exefile' in '.out'.  
Then I copied exefiles' values to UnixFile but modified 'DefaultIcon' to
'D:\WINDOWS\SYSTEM\shell32.dll,2' (substitute path as appropriate). 

It wasn't as easy with extensionless files though, it is possible to have a
key called '.' but when I modify it as above and try to execute them I 
get 'A required DLL file, *the executable*.EXE, was not found' (in bash 
I got the same message). Maybe some additional hacking would remove this 
too (in the copies of 'exefiles' values?) but this is as far as I want to 
go. Thirdly a key called '*' can be created, on my system it was already 
in use by Winzip so I didn't want to mess with it. I've seen some extensive 
books on the registry, but don't own one. 

I have no idea whether this might have some unexpected side-effects, but to
me it seems pretty safe (of course the fact that the file did not 
automatically get the 'executable' icon might be a bit suspect, executables 
are perhaps dealt with somewhere else too?).


cj
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019