B4J Question Run .exe of a driver installer under Windows

peacemaker

Expert
Licensed User
Longtime User
Hi, All

If to run manually SETUP.EXE under Win10 - OS's UAC requests the admin right confirmation, and the installer is started OK and shows the form window.
But if to start this SETUP.EXE by "fx.ShowExternalDocument(url)" - OS's UAC request is OK the same, but ... installer died with msgbox like "Not found application, install manually".

Any help ?
 
Solution
1732638894300.png


Installer set is so.
And it does not start if to use jShell.

And i think, UAC request here is the must.

p.s. hmm, OK - let Innosetup do its work. "Solved".

Chris2

Active Member
Licensed User
Longtime User
Does SETUP.EXE have dependencies? Perhaps files that are in the same folder?

You could try using jShell instead, setting the WorkingDirectory to the directory that SETUP.EXE is in.
 
Last edited:
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
regular setup for windows
yes

What software is in the setup?
driver for the CH340 USB bridge chip of many MCU PCBs.

It's OK installed when used in the Inno setup with elevated right:

Code:
[Run]
Filename: "{app}\DriverSetup\SETUP.EXE"; Flags: postinstall runascurrentuser unchecked; Description: "Install driver"; Check: IsWin64; AfterInstall: SetElevationBit('{app}\DriverSetup\SETUP.EXE')

[Code]
procedure SetElevationBit(Filename: string);
var
  Buffer: string;
  Stream: TStream;
begin
  Filename := ExpandConstant(Filename);
  Log('Setting elevation bit for ' + Filename);

  Stream := TFileStream.Create(FileName, fmOpenReadWrite);
  try
    Stream.Seek(21, soFromBeginning);
    SetLength(Buffer, 1);
    Stream.ReadBuffer(Buffer, 1);
    Buffer[1] := Chr(Ord(Buffer[1]) or $20);
    Stream.Seek(-1, soFromCurrent);
    Stream.WriteBuffer(Buffer, 1);
  finally
    Stream.Free;
  end;
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
1732638894300.png


Installer set is so.
And it does not start if to use jShell.

And i think, UAC request here is the must.

p.s. hmm, OK - let Innosetup do its work. "Solved".
 
Last edited:
Upvote 0
Solution
Top