FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Useful Dll for Inno Setup users (https://fileforums.com/showthread.php?t=95775)

rinaldo 27-10-2015 01:55

shortage of examples, in botva and in many others there are a dozen examples with the library, so you do so, that many of us use your library so fast .. not think peterf1999 ;)

peterf1999 27-10-2015 04:21

Quote:

Originally Posted by rinaldo (Post 444127)
shortage of examples, in botva and in many others there are a dozen examples with the library, so you do so, that many of us use your library so fast .. not think peterf1999 ;)

Did you read the exhaustive docs about functions/procedures on 1st page?
For sure, the use is not easy for inno's novice users.;)

rinaldo 27-10-2015 04:53

Quote:

Originally Posted by peterf1999 (Post 444130)
Did you read the exhaustive docs about functions/procedures on 1st page?
For sure, the use is not easy for inno's novice users.;)

I hope that your skills are better than your common sense :rolleyes:

Razor12911 27-10-2015 16:28

Quote:

Originally Posted by peterf1999 (Post 444125)
Code:

imgidx1:=loadimage(ExpandConstant('{tmp}\my.png'),WizardForm.Handle,0,0,450,750,IMF_Crop);
SetVisibleImgRgn(imgidx1,100,50,200,300);
DrawImages(WizardForm.Handle);

Code:

procedure SetVisibleImgRgn(ImgIdx,NewX,NewY,NewHeight,NewWidth: integer);
external 'SetVisibleImgRgn@files:Isab.dll stdcall delayload';


ok, got it. should be working on something now. :)

Quote:

Originally Posted by rinaldo (Post 444127)
shortage of examples, in botva and in many others there are a dozen examples with the library, so you do so, that many of us use your library so fast .. not think peterf1999 ;)

I don't think examples are needed for this. I mean if you read the code section from the help file that comes with Inno Setup.
which reads "
The [Code] section is an optional section that specifies a Pascal script. A Pascal script can be used to customize Setup or Uninstall in many ways. Note that creating a Pascal script is not easy and requires experience with Inno Setup and knowledge about programming in Pascal or at least a similar programming language."
The reason I'm saying there is no need for example is because simple types are always there to guide you on how to use a function, if you had a little bit of knowledge of pascal/delphi, you would know what I'm talking about and what makes peterf not make examples.

rinaldo 27-10-2015 21:23

razor... I did before opening the dll to read :D


peterf ...I found that it's a great project .. I noticed that the driver can not read DirectX .. what do you think of this option?

peterf1999 27-12-2015 05:47

1 Attachment(s)
Added the following procedure to dll:
  • RotateImg

Razor12911 31-12-2015 05:02

I wouldn't be surprised if you start adding animations. Great job mate.

peterf1999 08-01-2016 02:17

1 Attachment(s)
Added the following procedure/function to dll:
  • CreatePie
  • UpdatePie
  • CreateArc
  • UpdateArc
Changes:
  • Renamed 'DrawImages' procedure to 'DrawToDC'

rinaldo 08-01-2016 17:09

too thirsty for CPU this library :eek: :eek: :eek: :eek: :eek:

peterf1999 14-01-2016 00:00

1 Attachment(s)
Added the following function to dll:
  • CreateBtn
Code:

const
  LButtonUp = 1;
  LButtonDown = 2;
  MouseOver = 4;
  MouseOut = 8;

type
TBtnEvent= procedure(BtnIdx,EventID: integer);

function CreateBtn(const FileName: PAnsiChar; Handle: HWND; X,Y,Height,Width: integer; callback: TBtnEvent): integer;


peterf1999 16-01-2016 06:37

Added the following procedures/functions to dll:

Code:

procedure SetBtnEnabled(BtnIdx: integer; Enabled: Boolean); external 'SetBtnEnabled@files:Isab.dll stdcall delayload';

function GetBtnEnabled(BtnIdx: integer): Boolean; external 'GetBtnEnabled@files:Isab.dll stdcall delayload';

procedure SetBtnVisibility(BtnIdx: integer; Visibility: Boolean); external 'SetBtnVisibility@files:Isab.dll stdcall delayload';

function GetBtnVisibility(BtnIdx: integer): Boolean; external 'GetBtnVisibility@files:Isab.dll stdcall delayload';

procedure SetBtnTransparency(BtnIdx: Integer; BtnTransparency: Byte); external 'SetBtnTransparency@files:Isab.dll stdcall delayload';

function GetBtnTransparency(BtnIdx: Integer): byte; external 'GetBtnTransparency@files:Isab.dll stdcall delayload';


peterf1999 21-01-2016 09:49

1 Attachment(s)
Added the following procedure/function to dll:

Code:

procedure SetBtnCur(BtnIdx: integer; const FileName: PAnsiChar; CurHandle: DWord; const IFT_Cur: integer); external 'SetBtnCur@files:Isab.dll stdcall delayload';
function GetSysCur(const IDC: integer): DWord; external 'GetSysCur@files:Isab.dll stdcall delayload';


Cesar82 22-01-2016 17:37

Thank you for library isab.dll.

It would be interesting if you could add multimedia playback
based on DirectShow.
Addicionar functions as in InnoMediaPlayer and ISMediaLib (By altef_4) in your Isab.dll library.

peterf1999 31-01-2016 08:58

Changes: v0.0.8.6

Fixed an issue with WM_LBUTTONDOWN and WM_LBUTTONUP message handler.
Now the buttons work properly.

peterf1999 06-02-2016 04:39

Changes v0.0.8.7:
Fixed an issue with visibility (SetImgVisibility) of invalidated client area of rotated images.

peterf1999 12-02-2016 11:43

Changes:
  • Renamed 'CheckFileSHA1' function to 'CheckFileHash'.
  • function prototype changes.
  • Added support for MD5, SHA256(SHA-2) hash algorithms.
Code:

const
  DCP_MD5 = 1;
  DCP_SHA1 = 2;
  DCP_SHA256 = 4; // SHA-2

Type
THashProgress = function(OverallProgress,FileProgress: Integer): Boolean;

function CheckFileHash(const Filename,HashHex: PAnsichar; PctOfTotal: integer; callback: THashProgress; DCP_Hash: integer): integer; external 'CheckFileHash@files:Isab.dll stdcall delayload';

Function return codes:

0: All OK.
-1: Hash check aborted.
-2: File hash does not match.
-3: Source File not found.
-4: Bad flag argument.

peterf1999 02-03-2016 05:48

1 Attachment(s)
Changes: v0.0.9.0:

Added the following procedure/function to dll:
Code:

procedure SetBtnPosSize(BtnIdx,X,Y,Height,Width: integer); external 'SetBtnPosSize@files:Isab.dll stdcall delayload';
procedure GetBtnPosSize(BtnIdx: integer; var X,Y,Height,Width: integer); external 'GetBtnPosSize@files:Isab.dll stdcall delayload';
procedure SetBtnCaption(BtnIdx,CaptionLeftOffset,CaptionTopOffset: integer; const Caption, FontName: Pansichar; Size: integer; const FontStyle: integer; AntiAlias,Shadow: boolean); external 'SetBtnCaption@files:Isab.dll stdcall delayload';
function GetBtnCaption(BtnIdx: integer): PAnsichar; external 'GetBtnCaption@files:Isab.dll stdcall delayload';
procedure SetBtnCaptionColor(BtnIdx:integer; DefaultCaptionARGB, HoverCaptionARGB, LBtnDownCaptionARGB, DisabledCaptionARGB,ShadowCaptionARGB :Cardinal); external 'SetBtnCaptionColor@files:Isab.dll stdcall delayload';


peterf1999 12-03-2016 08:01

Added the following function to dll:

Code:

function GetDirectXVersion: Pansichar; external 'GetDirectXVersion@files:Isab.dll stdcall delayload';

peterf1999 14-03-2016 11:32

3 Attachment(s)
Changes v.0.0.9.2:
  • GetDirectXVersion function prototype changes.
Code:

const
  Dx_Gpu = 1; // DirectX supported by GPU
  Dx_Sys = 2; // DirectX installed on system

function GetDirectXVersion(const F_Dx: integer): Pansichar; external 'GetDirectXVersion@files:Isab.dll stdcall delayload';

Windows 7 Ultimate x64:

Attachment 13955

Windows 10 Pro x64:

Attachment 13956

BAMsE 23-03-2016 12:42

I can't create more than one timer with CreateTimer function. Only last defined TTimerProc is executed with the smallest Timeout defined:
Code:

ButtonCB := CreateTimer(10, @ButtonAction;
EqualizerCB := CreateTimer(100, @EqualizerAction);

In this case only EqualizerAction is executed with 10ms interval

peterf1999 24-03-2016 05:32

Quote:

Originally Posted by BAMsE (Post 448250)
I can't create more than one timer with CreateTimer function. Only last defined TTimerProc is executed with the smallest Timeout defined:
Code:

ButtonCB := CreateTimer(10, @ButtonAction;
EqualizerCB := CreateTimer(100, @EqualizerAction);

In this case only EqualizerAction is executed with 10ms interval

A function issue.
Thx for feedback

peterf1999 24-03-2016 08:19

Changes: v0.0.9.3:
Fixed an issue with multiple timers creation.

@Bamse
I should rewrite the entire JoinFile function :eek:

BAMsE 25-03-2016 11:56

Another issue:
Any PAnsiChar of TSysInfo or TVolume is empty after GetDirectXVersion execution.

BTW: what are possible results of GetDirectXVersion?

peterf1999 26-03-2016 08:48

Quote:

Originally Posted by BAMsE (Post 448265)
Another issue:
Any PAnsiChar of TSysInfo or TVolume is empty after GetDirectXVersion execution.

I don't have this issue, the function are separated :confused:

Quote:

Originally Posted by BAMsE (Post 448265)
BTW: what are possible results of GetDirectXVersion?

Ansi string of Directx version or null ansi string.

BAMsE 26-03-2016 12:49

2 Attachment(s)
One pic tells more...

Attachment 14056

... plus small bonus: executing DiskVolumeInfo before GetSysInfo messing strings returned by the first mentioned...

Attachment 14055

BAMsE 26-03-2016 17:20

GetFileVersionData causes file dependent errors AFTER gathering info from file on both UNICODE and ANSI (tested different exes, dlls). I mean errors are not random - some files always pass with the same flag, but fails with another (e.g. pckr.dll never fails with CompanyName or FileVersion but always fails with FileDescription or ProductName). Problematic strings are always correct - errors occur AFTER retrieving and returning them.
Code:

Runtime Error (at 750:30170):
Access violation at address 05C276A2 in module 'Isab.dll'. Read of address A7FFFFFC.

Code:

Runtime Error (at 750:30170):
Exception "EOleException" at address 00497587.


Code:

Runtime Error (at 2:273):
Exception "EOSError" at address 00497587.


peterf1999 27-03-2016 10:09

Send pm with links of scripts have raised the errors of:
GetFileVersionData
DiskVolumeInfo
GetSysInfo

I tested GetFileVersionDataW & GetFileVersionDataA on Altef_4's pckr.dll without errors. ( Inno Setup ultra v5.5.1 unicode, and v5.5.5 ansi).

BAMsE 27-03-2016 14:06

1 Attachment(s)
Any script, e.g. your example from post 59 I've modified it to induce errors - duplicated lines 'OSName' and 'HDDLabel' after GetDirectXVersion call. Also try to define INVERT.
GetFileVersionData seems to work fine :confused: maybe some fault of my rig (but yesterday deliberately turned OC off to avoid any misrepresentations). Now compiled with 5.5.8(a) gives Access violation at the end of setup. With 5.5.1.ee2(u) works fine.

Razor12911 27-03-2016 17:22

2 Attachment(s)
Watch example

Razor12911 27-03-2016 17:36

3 Attachment(s)
Hey peterf, there seems to be a problem with SaveFileFromBuffer function, after saving a file, handle is not closed so I'm getting OpenError exceptions.

Edit:
Also this, I don't know if I'm doing anything wrong here.

Request:
GetImgRotation function ;)

Razor12911 27-03-2016 18:09

2 Attachment(s)
Cryptfile example

BAMsE 28-03-2016 01:34

1 Attachment(s)
Razor use DrawToDC instead of DrawImages. There's no DrawImages export in ISab.dll :p See example.

peterf1999 28-03-2016 05:09

Quote:

Originally Posted by Razor12911 (Post 448279)
Hey peterf, there seems to be a problem with SaveFileFromBuffer function, after saving a file, handle is not closed so I'm getting OpenError exceptions.

Fixed.

The verdict that I already knew:
Sharing data structures ( TSysInfo or TVolume) or classes between two modules (inno setup exe and dlls )
in delphi/pascal is deprecated or even illegal. This is the reason of the issues,
but I always hated to export a single function for only one value.

All I need is to export each function e.g.:

Code:

function GetProcessorName: PAnsichar;
function GetFileSystemType: PAnsichar;
function GetCpuClockSpeed: integer;
...

and so on

Razor12911 28-03-2016 05:48

1 Attachment(s)
Yea well there was no DrawToDC on first page, I used it as reference.

peterf1999 29-03-2016 09:20

DiskVolumeInfo function replaced by:

Code:


const
  TF_InBytes = 1;
  TF_InKiloBytes = 2;
  TF_InMegaBytes = 4;
  TF_InGigaBytes = 8;

function GetDiskVolumeName(const RootDir: PAnsichar):PAnsichar; external 'GetDiskVolumeName@files:Isab.dll stdcall delayload';
function GetFileSystemName(const RootDir: PAnsichar):PAnsichar; external 'GetFileSystemName@files:Isab.dll stdcall delayload';
function GetVolumeFreeSpace(const RootDir: PAnsichar; const OutSizeType: Byte): Double; external 'GetVolumeFreeSpace@files:Isab.dll stdcall delayload';
function GetVolumeSize(const RootDir: PAnsichar; const OutSizeType: Byte): Double; external 'GetVolumeSize@files:Isab.dll stdcall delayload';


peterf1999 30-03-2016 08:18

GetSysInfo procedure replaced by:

Code:

function GetCpuName: PAnsichar; external 'GetCpuName@files:Isab.dll stdcall delayload';
function GetCpuMaxClockSpeed: integer; external 'GetCpuMaxClockSpeed@files:Isab.dll stdcall delayload';
function GetCpuCurrentClockSpeed: integer; external 'GetCpuCurrentClockSpeed@files:Isab.dll stdcall delayload';
function GetCpuManufacturer: PAnsichar; external 'GetCpuManufacturer@files:Isab.dll stdcall delayload';
function GetCpuPhysicalCores: integer; external 'GetCpuPhysicalCores@files:Isab.dll stdcall delayload';
function GetCpuLogicalCores: integer; external 'GetCpuLogicalCores@files:Isab.dll stdcall delayload';
function GetGpuName: PAnsichar; external 'GetGpuName@files:Isab.dll stdcall delayload';
function GetGpuRam: integer; external 'GetGpuRam@files:Isab.dll stdcall delayload';
function GetVideoDescription: PAnsichar; external 'GetVideoDescription@files:Isab.dll stdcall delayload';
function GetHorizontalResolution: PAnsichar; external 'GetHorizontalResolution@files:Isab.dll stdcall delayload';
function GetVerticalResolution: PAnsichar; external 'GetVerticalResolution@files:Isab.dll stdcall delayload';
function GetRefreshRate: PAnsichar; external 'GetRefreshRate@files:Isab.dll stdcall delayload';
function GetAudioDeviceName: PAnsichar; external 'GetAudioDeviceName@files:Isab.dll stdcall delayload';
function GetTotalVisibleMemory: integer; external 'GetTotalVisibleMemory@files:Isab.dll stdcall delayload';
function GetFreePhysicalMemory: integer; external 'GetFreePhysicalMemory@files:Isab.dll stdcall delayload';
function GetOSName: PAnsichar; external 'GetOSName@files:Isab.dll stdcall delayload';
function GetOSVersionMajor: Cardinal; external 'GetOSVersionMajor@files:Isab.dll stdcall delayload';
function GetOSVersionMinor: Cardinal; external 'GetOSVersionMinor@files:Isab.dll stdcall delayload';
function GetOSBuildNumbers: Cardinal; external 'GetOSBuildNumbers@files:Isab.dll stdcall delayload';
function GetServicePackMajorVersion: Word; external 'GetServicePackMajorVersion@files:Isab.dll stdcall delayload';
function GetServicePackMinorVersion: Word; external 'GetServicePackMinorVersion@files:Isab.dll stdcall delayload';
function GetOSArchitecture: Byte; external 'GetOSArchitecture@files:Isab.dll stdcall delayload';


altef_4 30-03-2016 10:09

Quote:

Originally Posted by peterf1999 (Post 448306)
GetSysInfo procedure replaced by:

Code:

function GetCpuName: PAnsichar; external 'GetCpuName@files:Isab.dll stdcall delayload';
function GetCpuMaxClockSpeed: integer; external 'GetCpuMaxClockSpeed@files:Isab.dll stdcall delayload';
function GetCpuCurrentClockSpeed: integer; external 'GetCpuCurrentClockSpeed@files:Isab.dll stdcall delayload';
function GetCpuManufacturer: PAnsichar; external 'GetCpuManufacturer@files:Isab.dll stdcall delayload';
function GetCpuPhysicalCores: integer; external 'GetCpuPhysicalCores@files:Isab.dll stdcall delayload';
function GetCpuLogicalCores: integer; external 'GetCpuLogicalCores@files:Isab.dll stdcall delayload';
function GetGpuName: PAnsichar; external 'GetGpuName@files:Isab.dll stdcall delayload';
function GetGpuRam: integer; external 'GetGpuRam@files:Isab.dll stdcall delayload';
function GetVideoDescription: PAnsichar; external 'GetVideoDescription@files:Isab.dll stdcall delayload';
function GetHorizontalResolution: PAnsichar; external 'GetHorizontalResolution@files:Isab.dll stdcall delayload';
function GetVerticalResolution: PAnsichar; external 'GetVerticalResolution@files:Isab.dll stdcall delayload';
function GetRefreshRate: PAnsichar; external 'GetRefreshRate@files:Isab.dll stdcall delayload';
function GetAudioDeviceName: PAnsichar; external 'GetAudioDeviceName@files:Isab.dll stdcall delayload';
function GetTotalVisibleMemory: integer; external 'GetTotalVisibleMemory@files:Isab.dll stdcall delayload';
function GetFreePhysicalMemory: integer; external 'GetFreePhysicalMemory@files:Isab.dll stdcall delayload';
function GetOSName: PAnsichar; external 'GetOSName@files:Isab.dll stdcall delayload';
function GetOSVersionMajor: Cardinal; external 'GetOSVersionMajor@files:Isab.dll stdcall delayload';
function GetOSVersionMinor: Cardinal; external 'GetOSVersionMinor@files:Isab.dll stdcall delayload';
function GetOSBuildNumbers: Cardinal; external 'GetOSBuildNumbers@files:Isab.dll stdcall delayload';
function GetServicePackMajorVersion: Word; external 'GetServicePackMajorVersion@files:Isab.dll stdcall delayload';
function GetServicePackMinorVersion: Word; external 'GetServicePackMinorVersion@files:Isab.dll stdcall delayload';
function GetOSArchitecture: Byte; external 'GetOSArchitecture@files:Isab.dll stdcall delayload';


You can try to use interfaces instead creating so many exported functions (but only for unicode version)

peterf1999 30-03-2016 10:25

Quote:

Originally Posted by altef_4 (Post 448311)
You can try to use interfaces instead creating so many exported functions (but only for unicode version)

I know, but I used the old procedure getsysinfo to retrieve values. It was the fastest way :D

BAMsE 01-04-2016 11:35

peterf1999 there was a problem with GetSysInfo (not tested with current version, but I think it will be too) on rigs with more than one graphic adapter
http://www.tgp-gaming.de/img/error.png

peterf1999 02-04-2016 04:31

Quote:

Originally Posted by BAMsE (Post 448335)
peterf1999 there was a problem with GetSysInfo (not tested with current version, but I think it will be too) on rigs with more than one graphic adapter
http://www.tgp-gaming.de/img/error.png

Which function (GetGpuName/GetGpuRam) fails?


All times are GMT -7. The time now is 14:36.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com