Mail Archives: djgpp/2001/06/29/18:57:50
Eli Zaretskii wrote:
>
> However, why is this a problem in your case? DOS programs in general
> and DJGPP programs in particular should not normally care about this.
My trouble is that I'm doing some small work on the Vim editor, improving the
DOS/Windows installer for it. For Windows versions, we make a call to
regedit.exe to add a context menu entry for Vim via a generated .reg file. I
realize that it is strange to be using DJGPP to generate Windows executables,
but in the interest of keeping things uniform, I am trying to keep the
installer functioning the same way for all builds that will run on a Windows
OS, even if they are technically DOS builds. The trouble is that with a
system("regedit ... "), regedit executes asynchronously, so we cannot know
when it has completed, thus, it is unsafe to delete the .reg file. As a way
around this, with most of the compiler platforms Vim builds on, we can make
the line system("start /wait regedit ..."), so that the installer does not
regain control until regedit has finished, then we can delete the file. That
works fine on Win9x, ME, and 2000, where there is a start.exe executable that
does that. On WinNT, though, it turns out that start is a shell built-in for
cmd.exe, but is not in command.com, thus the trouble.
>
>>if there is a way to identify the operating system the program is
>>running under
>>
>
> It's not easy. For example, there's no easy way we know of to
> distinguish NT from Windows 2000. But if you don't care about the
> difference, call _get_dos_version(1), and if it returns the version
> 5.50, you are on NT.
>
That could work satisfactorily I think. Windows 2000 should have a cmd.exe
also, so calling cmd.exe explicitly shouldn't cause any headaches.
Thanks!
-Jon
- Raw text -