Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3998286
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:30:24+00:00 2026-05-20T07:30:24+00:00

My program installs a driver, which has different versions compiled for XP, Win2003, Vista/Win2008,

  • 0

My program installs a driver, which has different versions compiled for XP, Win2003, Vista/Win2008, and Win7. I use pascal functions to check which is the OS, and install the corresponding DLL.

On some users’ systems no DLL is installed, which means all the functions have returned false. This should not happen so long as the OS’s major version is 5 or 6.

Can anyone tell me if there is something wrong with the code I use?

[Code]
function UseDriverForWindows7(): Boolean;
var
  Version: TWindowsVersion;
begin
  GetWindowsVersionEx(Version);

  // Windows 7 version is 6.1 (workstation)
  if (Version.Major = 6)  and
     (Version.Minor = 1) and
     (Version.ProductType = VER_NT_WORKSTATION)
  then
    Result := True
  else
    Result := False;
end;

function UseDriverForWindowsVistaAndWindows2008(): Boolean;
var
  Version: TWindowsVersion;
begin
  GetWindowsVersionEx(Version);

  // Anything with major version 6 where we won't use Windows 7 driver
  if (Version.Major = 6) and
     (not UseDriverForWindows7)
  then
    Result := True
  else
    Result := False;
end;

function UseDriverForWindows2003(): Boolean;
var
  Version: TWindowsVersion;
begin
  GetWindowsVersionEx(Version);

  // Windows 2003 version is 5.2 (server)
  if (Version.Major = 5)  and
     (Version.Minor = 2)  and
     (Version.ProductType <> VER_NT_WORKSTATION)
  then
    Result := True
  else
    Result := False;
end;

function UseDriverForWindowsXP(): Boolean;
var
  Version: TWindowsVersion;
begin
  GetWindowsVersionEx(Version);

  // Anything with major version 5 where we won't use Windows 2003 driver
  if (Version.Major = 5) and
     (not UseDriverForWindows2003)
  then
    Result := True
  else
    Result := False;
end;

[Files]
Source: "mydrv-xp-x86.dll"; DestDir: {app}; DestName: mydrv.dll; Check: not IsWin64 and UseDriverForWindowsXP; Flags: ignoreversion
Source: "mydrv-2003-x86.dll"; DestDir: {app}; DestName: mydrv.dll; Check: not IsWin64 and UseDriverForWindows2003; Flags: ignoreversion
Source: "mydrv-vista-x86.dll"; DestDir: {app}; DestName: mydrv.dll; Check: not IsWin64 and UseDriverForWindowsVistaAndWindows2008; Flags: ignoreversion
Source: "mydrv-win7-x86.dll"; DestDir: {app}; DestName: mydrv.dll; Check: not IsWin64 and UseDriverForWindows7; Flags: ignoreversion
Source: "mydrv-xp-x64.dll"; DestDir: {app}; DestName: mydrv.dll; Check: IsWin64 and UseDriverForWindows2003; Flags: ignoreversion
Source: "mydrv-vista-x64.dll"; DestDir: {app}; DestName: mydrv.dll; Check: IsWin64 and UseDriverForWindowsVistaAndWindows2008; Flags: ignoreversion
Source: "mydrv-win7-x64.dll"; DestDir: {app}; DestName: mydrv.dll; Check: IsWin64 and UseDriverForWindows7; Flags: ignoreversion
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:30:25+00:00Added an answer on May 20, 2026 at 7:30 am

    You should use the common parameters MinVersion and OnlyBelowVersion in conjunction with the function IsWin64.

    Update

    To distinguish between workstation and server versions you can use the GetWindowsVersionEx function which is integrated in Inno Setup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.