0

We have a minimum System requirement of Server 2012 and Windows 8.1.

We have programs written on C++.

Some programs in our Setup still don't use newer DLLs and start on a Windows 7 or Windows 2008 R2. Some use newer DLLs and don't start with a message that such a DLL isn't found.

Is there a way to prevent the start of a program on an old Windows System with a manifest or something similar? I would prefer that the user don't see a "DLL not found message".

The best way: Windows Loader tells the user that the executable doesn't match this OS.

I know that this works for Windows executables of the OS. Copying a newer EXE from Windows 10 to an old Windows version, even if new specific DLLs are not used.

xMRi
  • 14,982
  • 3
  • 26
  • 59
  • Does this help: https://stackoverflow.com/questions/29944745/get-osversion-in-windows-using-c – Nikola Oct 26 '21 at 07:08
  • This is possible for the programs that can start. But programs that use a new OS DLL just popup that the program doesn't run because "DLL not found". I don't like to see the "DLL not found" message. Sorry if my question wasn't clear. – xMRi Oct 26 '21 at 07:15
  • You can try loading dll with https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibrarya If it is unsuccessful you can display message. – Nikola Oct 26 '21 at 07:19
  • 1
    use the [`/SUBSYSTEM`](https://learn.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem?view=msvc-160) and here set minimum required version of the subsystem. for instance `/SUBSYSTEM:Windows,6.3` - and exe start only on win 8.1 or higer version – RbMm Oct 26 '21 at 08:00
  • 1
    *this works for Windows executables of the OS.* - exactly because this - `MajorSubsystemVersion.MinorSubsystemVersion` set in `IMAGE_OPTIONAL_HEADER` and this is set linker from `/SUBSYSTEM:x,M.m` – RbMm Oct 26 '21 at 08:02
  • I have the habit to renaming my program, adding an underscore at the beginning of the name. So, the program is not found and hence, is not started :-) – Dominique Oct 26 '21 at 09:14
  • The Linker SUBSYSTEM option is what I searched for. – xMRi Oct 26 '21 at 09:19

0 Answers0