FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   INNO TROUBLESHOOT - Questions Here (https://fileforums.com/showthread.php?t=93193)

Lord.Freddy 16-09-2022 12:48

1 Attachment(s)
Quote:

Originally Posted by Masquerade (Post 498156)
That appears to only do Splash screen judging by the iss examples and by looking at the DLL exports

@Masquerade

I try apply gif in WizardForm in a month ago and now...
Use GifLib by SkyGZ(Support All version of innoSetup)

Lord.Freddy 16-09-2022 12:58

Quote:

Originally Posted by PercyMaliek (Post 498363)
I'm bloody new to Inno Setup script.
I've created the bins for a game, but I'm unsure how to have Inno decompress them

Compression was PrecompX+srep+lolz

precompx\x64\PrecompX.exe -e - - <stdin> <stdout>
srep\srep.exe -m3f -l512 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
lolz\lolz_x64.exe -d256 -mc192 -mt4 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp

Besides a few basic tutorials, I've not come across anything about decompression with ISS...

If you use freearc for compression well need a library to call unarc.dll for extract files(isdone.dll). Search on this forum, download example script like ASIS OR Lite installer ... see a script, learn and use.

KaktoR 16-09-2022 13:30

You don't need ISDone library, there is ISArcEx here: https://fileforums.com/showthread.php?t=104980

If you want to use ISDone library, there is a example script somewhere on the internet, most likely where ISDone library is shared by it's creator (krinkels.org)

Moreover, to a new person I would not suggest scripts like ASIS, CIU and such to learn about this, they are just too much.

L33THAK0R 26-09-2022 12:09

Has anyone implemented Inno Download Plugin in their script? I'm looking to implement it be able to offer redist. packages like Nvidia's PhysX (for titles such as the first two "Metro" titles and some Ubisoft titles) to the end-user, whilst avoiding having to include the executable itself (since some are still 35MB+ after packing them!) and instead fetching a download link. If anyone could show me their implementation I'd very much appreciate any insight anyone could offer!

Cesar82 26-09-2022 12:26

Quote:

Originally Posted by L33THAK0R (Post 498515)
Has anyone implemented Inno Download Plugin in their script? I'm looking to implement it be able to offer redist. packages like Nvidia's PhysX (for titles such as the first two "Metro" titles and some Ubisoft titles) to the end-user, whilst avoiding having to include the executable itself (since some are still 35MB+ after packing them!) and instead fetching a download link. If anyone could show me their implementation I'd very much appreciate any insight anyone could offer!

As I remember this plugin didn't work with most of the links (I could be wrong).
I recommend using DwinsHs (Downloader for Inno Setup).
DwinsHs already has an example script.
I use DwinsHs code in DiskSpan GUI to download plugins and it works great.

L33THAK0R 26-09-2022 20:48

Quote:

Originally Posted by Cesar82 (Post 498516)
As I remember this plugin didn't work with most of the links (I could be wrong).
I recommend using DwinsHs (Downloader for Inno Setup).
DwinsHs already has an example script.
I use DwinsHs code in DiskSpan GUI to download plugins and it works great.

This definitely looks easier to implement! Thanks a bunch for linking this. However looking at my problem after a good nights sleep (I'm always far too tired writing out any questions here I swear), I think I'll just use powershell to download the file, since running the installer requires elevated privileges already (also means a lot less work wrangling this plugin). One day though I'll probably migrate to using an actual plugin instead of a series of scripts.

Dragonis40 30-11-2022 02:59

Hello everybody! I have an issue with isskin.dll in inno setup welcome page final exe: if I use a version of isskin.dll (395.184 byte, date: 02/12/2012) and mouse scroll, welcome page text scrolls, the scrollbar appears, but it doesn't work (if I try to move scrollbar by using mouse left button or by pressing scrollup or scrolldown button, nothing happens).
If I use another version of isskin.dll (395.184 byte, date: 04/11/2009) and mouse scroll, welcome page text scrolls, the scrollbar appears AND IT works, but the skin i've choosen DOESN'T work (the skin is white reguardless *.cjstyles file).
I've tried several isskin.dll versions founded on internet, but nothing different happens.

Is it a bug? Do I need a specific version of isskin.dll? Thank you!

Masquerade 04-01-2023 10:36

Hi!

Is there a way to enforce compatibility mode for an executable using Inno Setup?

For example, Crysis in my tests requires compatbility mode to be set to Win Vista SP2 so I was wondering if this can be done automatically after the game has been decompressed onto the users' computer.

Thanks!

KaktoR 04-01-2023 11:13

Yes you have to make it with registry.

L33THAK0R 11-01-2023 05:54

Is there any way to execute a registry update as the first operation of an install? I'm currently packing the "LEGO" games by the "Traveler's Tales" developers and as many of you undoubtedly know the unpacked "*.dat" archives can have some rather long paths for some files, particularly in newer titles. As a fix to this I'm currently planning to launch either a basic registry script in the form of a ".reg" or use Inno Setup's built-in registry functions to disable Window's 256 character limit (which is perfectly safe to do and only requires a very small modification, I honestly don't know why it isn't disabled by default), but I'm currently a tad unsure how to proceed, has anyone accomplished anything similar in the past, that they'd be willing to share details on?

Masquerade 11-01-2023 07:02

^^
I don't see why you wouldn't be able to put an Exec2 leading to a batch file before ISDone (or whatever implementation you use to bridge Inno Setup and FreeArc) starts.

A suggestion,

Paste this into a batch file and save it as disable_path_limit.bat:

Code:

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d 1 /f
Add this section to the [Files] section in your script:
Code:

Source: disable_path_limit.bat;  DestDir: {tmp}; Flags: dontcopy
Then somewhere in your script (e.g. just after arc.ini is extracted for example), add this code section:
Code:

ExtractTemporaryFile('disable_path_limit.bat');
Exec2(ExpandConstant('{tmp}\disable_path_limit.bat'),'',false);
DeleteFile(ExpandConstant('{tmp}\disable_path_limit.bat'));

Providing that you put that section of code just after arc.ini is extracted (if you are unsure where this is, CTRL+F for "ExtractTemporaryFile('arc.ini');" to find it easy) it will run and the reg will get updated before the archives are unpacked.

Note that this batch file requires admin permissions so providing the installer is running in an elevated state, the script should face no issues.

L33THAK0R 11-01-2023 21:01

Quote:

Originally Posted by Masquerade (Post 499732)
^^
I don't see why you wouldn't be able to put an Exec2 leading to a batch file before ISDone (or whatever implementation you use to bridge Inno Setup and FreeArc) starts.

A suggestion,

Paste this into a batch file and save it as disable_path_limit.bat:

Code:

REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v "LongPathsEnabled" /t REG_DWORD /d 1 /f
Add this section to the [Files] section in your script:
Code:

Source: disable_path_limit.bat;  DestDir: {tmp}; Flags: dontcopy
Then somewhere in your script (e.g. just after arc.ini is extracted for example), add this code section:
Code:

ExtractTemporaryFile('disable_path_limit.bat');
Exec2(ExpandConstant('{tmp}\disable_path_limit.bat'),'',false);
DeleteFile(ExpandConstant('{tmp}\disable_path_limit.bat'));


This is definitely a much simpler approach, rather than additional inno-setup-native functionality, and it seems to work a treat! Cheers for the help mate!

UPDATE: It seems that FreeArc doesn't like Long Paths regardless of the registry, looks like I'll have to resign myself to using a shorter default folder name.

Dragonis40 31-01-2023 02:31

Good morning everybody! Is there any way to add a check box in setup.exe for unnecessary .bin files (e.g. soundtracks, manuals, .png images, bonus content in general) and the corresponding instructions in archives.ini file for inno setup? Which are the needed instructions for it? Thank you so much!

Cesar82 05-02-2023 09:05

1 Attachment(s)
Does anyone know how to change the border cursor of an EDIT?
See the attached file.
I would like the cursor when entering the edit to also display the "Hand" cursor and not the "Arrow" cursor.
P.S: If you disable the Edit border, this cursor is not displayed.
Although the attachment file is created in delphi I would like a solution that I can use in Inno Setup.
Thanks!

Lord.Freddy 10-04-2023 07:52

Why doesn't (innoSetup) compile my script?
 
Code:

#define public RequiredSpace "1000"

#define MbToBytes(str *Value) \
  Local[1] = MbToBytes((Value)), \
  Local[1]

[Setup]
AppName=111
AppVersion=0.0
AppPublisher=bbbbb
DefaultDirName={autopf}\111
ExtraDiskSpaceRequired={#MbToBytes(RequiredSpace)}

[_Code]
function MbToBytes(Value: Integer): Integer;
begin
  Result := (Value * (1024 * 1024));
end;


Cesar82 10-04-2023 10:10

You cannot mix ISPP and CODE section codes.
Try like this:
Code:

#define public RequiredSpace "1000"

#define MbToBytes(str Value) \
  Int(Value, 0) * 1024 * 1024

[Setup]
AppName=111
AppVersion=0.0
AppPublisher=bbbbb
DefaultDirName={autopf}\111
ExtraDiskSpaceRequired={#MbToBytes(RequiredSpace)}


Lord.Freddy 10-04-2023 10:22

Quote:

Originally Posted by Cesar82 (Post 500110)
Does anyone know how to change the border cursor of an EDIT?
See the attached file.
I would like the cursor when entering the edit to also display the "Hand" cursor and not the "Arrow" cursor.
P.S: If you disable the Edit border, this cursor is not displayed.
Although the attachment file is created in delphi I would like a solution that I can use in Inno Setup.
Thanks!

I found this, but I don't know if it works or not
Code:

[_Code]
const
  IDC_MYCURSOR = 100; // Custom cursor ID

var
  MyCursor: HCURSOR;

function LoadCursorFromFile(lpFileName: string): HCURSOR;
  external '[email protected] stdcall';

procedure InitializeWizard;
begin
  MyCursor := LoadCursorFromFile('C:\Path\To\MyCursor.cur');
end;

procedure CurPageChanged(CurPageID: Integer);
var
  EditHandle: HWND;
begin
  if CurPageID = wpSelectDir then begin
    EditHandle := WizardForm.DirEdit.Handle;
    SendMessage(EditHandle, EM_SETCURSOR, 0, LPARAM(MyCursor));
  end;
end;


BLACKFIRE69 29-04-2023 06:33

Help
 
does anyone know how to convert this following Delphi code into InnoSetup?
alternatively, if you have any other suggestions on how to accomplish this in a similar manner, please feel free to share your thoughts. thanks.

Code:

uses
  Winapi.Windows, System.SysUtils;

type
  TFuncX = procedure(const Var1: Integer); cdecl;
  TFuncY = function(const Count: Longint; var Str: AnsiString): Integer; cdecl;
  TFuncZ = procedure(const Str1, Str2: WideString); cdecl;
  TFuncCommon = record
    case Integer of
      0: (FuncX: TFuncX);
      1: (FuncY: TFuncY);
      2: (FuncZ: TFuncZ);
  end;

function MySafeLoadLibFunc(const LibName, FuncName: WideString;
  var Func: TFuncCommon; var ErrorStr: WideString): Cardinal;
begin
  ErrorStr := '';
  Result := LoadLibraryW(PWideChar(LibName));
  if Result > 32 then begin
    try
      case Integer(Func) of  // Get the address of the function by name
        0: Func.FuncX := GetProcAddress(Result, PWideChar(FuncName));
        1: Func.FuncY := GetProcAddress(Result, PWideChar(FuncName));
        2: Func.FuncZ := GetProcAddress(Result, PWideChar(FuncName));
      end;
      if not Assigned(Pointer(Integer(Func))) then begin
        ErrorStr := 'Could not find function "' + FuncName + '" in library "' + LibName + '"';
        Result := 0;
      end;
    except
      on E: Exception do begin
        ErrorStr := 'Error loading function "' + FuncName + '" from library "' + LibName + '": ' + E.Message;
        Result := 0;
      end;
    end;
  end else ErrorStr := 'Could not load library "' + LibName + '"';

  if ErrorStr = '' then ErrorStr := 'empty';
end;

Code:

USAGE:

procedure Test;
var
  MyFunc: TFuncCommon;
  ErrorStr: WideString;
  LibModule: Cardinal;
  TmpStr: AnsiString;
begin
  try
    LibModule := MySafeLoadLibFunc('MyDll.dll', 'MyFunc3', MyFunc, ErrorStr);
    if LibModule > 32 then
    begin
      //MyFunc.FuncX(69);                // Call function FuncX
      //MyFunc.FuncY(47, TmpStr);        // Call function FuncY
      MyFunc.FuncZ('Hello', 'World');  // Call function FuncZ

      FreeLibrary(LibModule); // Free MyDll.dll
    end
    else WriteLn(ErrorStr);
  except
    on E: Exception do WriteLn(E.ClassName, ': ', E.Message);
  end;
end;



Code:

MyDll:

library MyDll;

uses
  System.SysUtils, Winapi.Windows;

{$R *.res}

function ShowMsg(const Msg: WideString; Caption: WideString = 'A Msg From MyDll.dll'): Integer; cdecl;
begin
  Result := MessageBoxW(0, PWideChar(Msg), PWideChar(Caption), MB_OK);
end;

procedure MyFunc1(const Var1: Integer); cdecl;
begin
  ShowMsg('[MyFunc1] : Var1  =  ' + IntToStr(Var1));
end;

function MyFunc2(const Count: Longint; var Str: AnsiString): Integer; cdecl;
begin
  Str := 'BLACKFIRE';
  Result := -10;
  ShowMsg('[MyFunc2] : Count  =  ' + IntToStr(Count));
end;

procedure MyFunc3(const Str1, Str2: WideString); cdecl;
begin
  ShowMsg('[MyFunc3] : Str1  =  ' + Str1 + ',  Str2  =  ' + Str2);
end;

exports MyFunc1, MyFunc2, MyFunc3;

begin
end.


Junior53 05-05-2023 01:52

Can someone explain what this is used for and what is filemapping?
 
Code:

function CreateFileMapping(
  File: Cardinal; Attributes: Cardinal; Protect: Cardinal;
  MaximumSizeHigh: Cardinal; MaximumSizeLow: Cardinal; Name: PAnsiChar): Cardinal;
  external '[email protected] stdcall';
 
function MapViewOfFile(
  FileMappingObject: THandle; DesiredAccess: Cardinal; FileOffsetHigh: Cardinal;
  FileOffsetLow: Cardinal; NumberOfBytesToMap: Cardinal): PChar;
  external '[email protected] stdcall';

What is FileMapping & benefits of FileMapping?

File mapping is a technique that allows you to map the contents of a file into the virtual memory space of a process. This allows you to access the contents of the file as if it were in memory, rather than on disk.
There are several benefits to using file mapping:

• Performance: File mapping can improve the performance of file I/O operations by reducing the number of disk accesses. When you map a file into memory, the operating system can use its virtual memory management mechanisms to cache the contents of the file in memory. This means that subsequent accesses to the file can be satisfied from memory, rather than requiring a disk access.

• Concurrency: File mapping allows multiple processes to access the same file concurrently. When multiple processes map the same file into their virtual memory space, they can all access the contents of the file simultaneously. This can be useful for inter-process communication and data sharing.

• Ease of use: File mapping allows you to access the contents of a file using memory-mapped I/O operations, rather than traditional file I/O operations. This can make it easier to work with files, as you can use pointer arithmetic and other memory-based operations to manipulate the contents of the file.
Overall, file mapping is a powerful technique that can improve the performance and ease-of-use of file I/O operations. It is widely used in many different types of applications and is supported by most modern operating systems.

IRAQIGHOST 06-05-2023 14:23

error everytime
 
Hi
In last days I used method (xt_zlib+srep_new:3+LOLZ_NORMAL) DiskSpan
In thes games
Call of Duty Ghosts
Call of Duty Black Ops 4
A Plague Tale Requiem

but every time after click on install this what come to me
https://i.ibb.co/rGnJSM6/Desktop-06-...-14-11-734.png

what is the wrong that I did?

Cesar82 06-05-2023 16:38

Quote:

Originally Posted by IRAQIGHOST (Post 501043)
Hi
In last days I used method (xt_zlib+srep_new:3+LOLZ_NORMAL) DiskSpan
In thes games
Call of Duty Ghosts
Call of Duty Black Ops 4
A Plague Tale Requiem

but every time after click on install this what come to me
https://i.ibb.co/rGnJSM6/Desktop-06-...-14-11-734.png

what is the wrong that I did?

I don't know if that's it, more the ISDone limits the number of characters to 255 or 260 characters.
Make sure the selected installation path is not too long. Try installing in a folder like "D:\Games\Call of Duty Ghosts"
It also cannot contain special characters in the installation path.

KaktoR 17-05-2023 14:37

My question is not about INNO but batch. Since batch is not something I deal everyday with, I need some help here. I don't want to open a new topic for this.

I have some files which I extract with a tool. The problem is that the extracted folders have the exact name as the files.

For example
Code:

File1.abc > Folder1.abc
File2.abc > Folder2.abc
...

Basically I need to get rid of the ".abc" in the folder names.


I already tried something like this but didn't work.
Code:

for /d %%i in (*.abc) do ren "%%~i" *

Cesar82 17-05-2023 18:45

Quote:

Originally Posted by KaktoR (Post 501123)
My question is not about INNO but batch. Since batch is not something I deal everyday with, I need some help here. I don't want to open a new topic for this.

I have some files which I extract with a tool. The problem is that the extracted folders have the exact name as the files.

For example
Code:

File1.abc > Folder1.abc
File2.abc > Folder2.abc
...

Basically I need to get rid of the ".abc" in the folder names.


I already tried something like this but didn't work.
Code:

for /d %%i in (*.abc) do ren "%%~i" *

Try
Code:

for /d %%i in (*.abc) do ren "%%~i" "%%~ni"

KaktoR 18-05-2023 01:10

Thanks this works :)

shazzla 18-05-2023 05:02

Hi all !

How can i get the installed app's path to 'DefaultDirName' ?

I have a reg-entry :
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\ Windows\CurrentVersion\Uninstall\MyApp]
"InstallLocation"="D:\\MyProgram"

Theoretically in InnoSetup's [setup] section

DefaultDirName={reg:HKLM64\HKEY_LOCAL_MACHINE\SOFT WARE\Microsoft\Windows\CurrentVersion\Uninstall\My App, InstallLocation}

should do the job. But no... Any idea ?

Note : (there are "spaces" in the example paths,etc. Its only visible here,dont know why. I my script they doesnt exists. No matter.)

Cesar82 18-05-2023 06:51

Quote:

Originally Posted by shazzla (Post 501135)
Hi all !

How can i get the installed app's path to 'DefaultDirName' ?

I have a reg-entry :
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\ Windows\CurrentVersion\Uninstall\MyApp]
"InstallLocation"="D:\\MyProgram"

Theoretically in InnoSetup's [setup] section

DefaultDirName={reg:HKLM64\HKEY_LOCAL_MACHINE\SOFT WARE\Microsoft\Windows\CurrentVersion\Uninstall\My App, InstallLocation}

should do the job. But no... Any idea ?

Note : (there are "spaces" in the example paths,etc. Its only visible here,dont know why. I my script they doesnt exists. No matter.)

Try
Code:

DefaultDirName={reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\My App_is1,InstallLocation|{pf}\My App}
UsePreviousAppDir=no

The value {pf}\My App is default dir if not found value in windows registry.

shazzla 18-05-2023 21:13

Thank you very much!
I will try and report back ASAP !

Its working fine !
Thanks ! :)

Junior53 07-06-2023 17:44

Quote:

Originally Posted by BLACKFIRE69 (Post 500980)
does anyone know how to convert this following Delphi code into InnoSetup?
alternatively, if you have any other suggestions on how to accomplish this in a similar manner, please feel free to share your thoughts. thanks.

Code:

uses
  Winapi.Windows, System.SysUtils;

type
  TFuncX = procedure(const Var1: Integer); cdecl;
  TFuncY = function(const Count: Longint; var Str: AnsiString): Integer; cdecl;
  TFuncZ = procedure(const Str1, Str2: WideString); cdecl;
  TFuncCommon = record
    case Integer of
      0: (FuncX: TFuncX);
      1: (FuncY: TFuncY);
      2: (FuncZ: TFuncZ);
  end;

function MySafeLoadLibFunc(const LibName, FuncName: WideString;
  var Func: TFuncCommon; var ErrorStr: WideString): Cardinal;
begin
  ErrorStr := '';
  Result := LoadLibraryW(PWideChar(LibName));
  if Result > 32 then begin
    try
      case Integer(Func) of  // Get the address of the function by name
        0: Func.FuncX := GetProcAddress(Result, PWideChar(FuncName));
        1: Func.FuncY := GetProcAddress(Result, PWideChar(FuncName));
        2: Func.FuncZ := GetProcAddress(Result, PWideChar(FuncName));
      end;
      if not Assigned(Pointer(Integer(Func))) then begin
        ErrorStr := 'Could not find function "' + FuncName + '" in library "' + LibName + '"';
        Result := 0;
      end;
    except
      on E: Exception do begin
        ErrorStr := 'Error loading function "' + FuncName + '" from library "' + LibName + '": ' + E.Message;
        Result := 0;
      end;
    end;
  end else ErrorStr := 'Could not load library "' + LibName + '"';

  if ErrorStr = '' then ErrorStr := 'empty';
end;

Code:

USAGE:

procedure Test;
var
  MyFunc: TFuncCommon;
  ErrorStr: WideString;
  LibModule: Cardinal;
  TmpStr: AnsiString;
begin
  try
    LibModule := MySafeLoadLibFunc('MyDll.dll', 'MyFunc3', MyFunc, ErrorStr);
    if LibModule > 32 then
    begin
      //MyFunc.FuncX(69);                // Call function FuncX
      //MyFunc.FuncY(47, TmpStr);        // Call function FuncY
      MyFunc.FuncZ('Hello', 'World');  // Call function FuncZ

      FreeLibrary(LibModule); // Free MyDll.dll
    end
    else WriteLn(ErrorStr);
  except
    on E: Exception do WriteLn(E.ClassName, ': ', E.Message);
  end;
end;



Code:

MyDll:

library MyDll;

uses
  System.SysUtils, Winapi.Windows;

{$R *.res}

function ShowMsg(const Msg: WideString; Caption: WideString = 'A Msg From MyDll.dll'): Integer; cdecl;
begin
  Result := MessageBoxW(0, PWideChar(Msg), PWideChar(Caption), MB_OK);
end;

procedure MyFunc1(const Var1: Integer); cdecl;
begin
  ShowMsg('[MyFunc1] : Var1  =  ' + IntToStr(Var1));
end;

function MyFunc2(const Count: Longint; var Str: AnsiString): Integer; cdecl;
begin
  Str := 'BLACKFIRE';
  Result := -10;
  ShowMsg('[MyFunc2] : Count  =  ' + IntToStr(Count));
end;

procedure MyFunc3(const Str1, Str2: WideString); cdecl;
begin
  ShowMsg('[MyFunc3] : Str1  =  ' + Str1 + ',  Str2  =  ' + Str2);
end;

exports MyFunc1, MyFunc2, MyFunc3;

begin
end.


I recommend you to use ChatGPT or Bing Ai for this!

Masquerade 08-06-2023 00:32

Quote:

Originally Posted by Junior53 (Post 501291)
I recommend you to use ChatGPT or Bing Ai for this!

ChatGPT is notoriously bad at writing complicated code. Sure, it can write simple algorithms, I use it sometimes to write quick scripts for making my repacks, but anything beyond this it usually gets the syntax wrong or the program will not work.

Junior53 08-06-2023 03:03

Quote:

Originally Posted by Masquerade (Post 501294)
ChatGPT is notoriously bad at writing complicated code. Sure, it can write simple algorithms, I use it sometimes to write quick scripts for making my repacks, but anything beyond this it usually gets the syntax wrong or the program will not work.

Actually, I told him to use it because he can get an simple idea of ​​how to do this.

Junior53 23-06-2023 09:14

Question's
 
01.how to show Component Page before the Select Dir Page (without creating custom forms or anything like that) in Inno setup 5.5.1 ee2 version?

02.how to calculate the required disk space based on the components selected and show in gigabyte on Component page in Inno setup 5.5.1 ee2 version?

I actually found an answer to this. But it doesn't work. If someone gives an answer to these two, it will be a great help <3

Code:

var
  Component1Size: Extended;
  Component2Size: Extended;
  // Add variables for each component as needed

procedure InitializeWizard;
begin
  Component1Size := 1048576;
  Component2Size := 2097152;
  // Assign sizes for other components if needed
end;

function GetTotalSize: String;
var
  TotalSize: Extended;
begin
  TotalSize := 0;
  if WizardForm.ComponentsList.Checked[0] then
    TotalSize := TotalSize + Component1Size;
  if WizardForm.ComponentsList.Checked[1] then
    TotalSize := TotalSize + Component2Size;
  // Add similar lines for other components if needed

  Result := FormatFloat('#,##0.00', TotalSize / 1024 / 1024 / 1024); // Convert bytes to gigabytes
end;

procedure ComponentsPageOnNextButtonClick(Sender: TWizardPage; var Continue: Boolean);
begin
  if Sender.ID = wpSelectComponents then
    WizardForm.DiskSpaceLabel.Caption := 'Required disk space: ' + GetTotalSize + ' GB';
end;


-tara 15-07-2023 07:19

Hello everybody,
I'm using IsArcEx for FreeArc archive decompression and I am attempting to apply a hdiffz patch after install, here is how I'm doing so:

Code:

procedure patching;
var
  ResultCode: Integer;
begin
      Exec(ExpandConstant('{tmp}\hpatchz.exe'), (ExpandConstant('{app}\...\file.one {app}\...\file.two {app}\...\file.three')), (ExpandConstant('{app}')), SW_SHOW, ewWaitUntilTerminated, ResultCode)
   
      DeleteFile (ExpandConstant('{app}\...\file.one'));
      DeleteFile (ExpandConstant('{app}\...\file.two'));
end;

Where patching is refrenced:
Code:

    if (ISArcDiskAddingSuccess) and ISArcExInit(MainForm.Handle, {#TimeFormat}, @ProgressCallback) then
    begin
      repeat
        if ISArcExDiskCount = 0 then begin
          MsgBox('There is no any archive found for unpacking.', mbError, MB_OK);
          break;
        end;

        ChangeLanguage('English');
        //ChangeLanguage('Russian');

        for i := 1 to ISArcExDiskCount do begin
          ISArcExError := not ISArcExExtract(i, ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'));
          if ISArcExError then break;
        end;
      until true;
      patching();
      ISArcExStop;

      if ISArcExError then
        MsgBox('Installation is corrupted.', mbError, MB_OK)
    end;

    HideControls;
    WizardForm.CancelButton.Visible := true;
    WizardForm.CancelButton.Enabled := false;
  end;

However, what ends up happening is the patch does not apply and after decompression the timer immediately ends.
What I would like to happen is the timer continuing and after the patch is applied for it to end. Thanks in advance

-tara 16-07-2023 08:04

audiofeel, How would I achieve this without utilizing FMXInno.dll?

-tara 16-07-2023 13:30

Quick update.
What I was doing was using absolute paths instead of using relative ones, this lead the patch to attempt to execute but it would lead to an error.
The way I fixed it, if anyone encounters this issue in the future was to copy the necessary files to {app} and run with relative paths there.

Lord.Freddy 22-07-2023 13:09

SelectDisk
 
1 Attachment(s)
Hello everyone, I am trying to implement the function (SelectDisk) that is available in (InnoSetup) 6, so I wrote the code that is in the (zip) file below, but after execution

1: If I click on the (OK) button and if the requested file is not there, it should give me an error, but it ignores this.

2: If I click on the (cancel) button, it should show me the exit message box, but it ignores it.

I will be glad if someone can fix the problems of this code :)

Cesar82 22-07-2023 18:37

1 Attachment(s)
Quote:

Originally Posted by Lord.Freddy (Post 501671)
Hello everyone, I am trying to implement the function (SelectDisk) that is available in (InnoSetup) 6, so I wrote the code that is in the (zip) file below, but after execution

1: If I click on the (OK) button and if the requested file is not there, it should give me an error, but it ignores this.

2: If I click on the (cancel) button, it should show me the exit message box, but it ignores it.

I will be glad if someone can fix the problems of this code :)

The functions "TNewDiskForm.OnCloseQuery " or "TNewDiskForm.OnClose" are called before returning a ShowModal value.
I recommend putting OnClick procedures for the "OK" and "Cancel" buttons and putting your functions there, then you can set the values of the global variable "ModalResult".

Tmills 06-08-2023 03:29

Hey, I'm a new member and joined yesterday. I am a complete noob but have learned a lot reading through this forum in just one day. I am currently using ASIS: Advanced Simple Installer Script and want to change the background JPG slideshow to a GIF image. I have found GifLib.dll but do not know how to adjust the script code and wondered if someone with know-how can do this for me or show me what needs changing. I have no coding experience, but I learn pretty quick, I'm a visual learner.

I have put the GifLib.dll in ASIS.v7.4.4\Resources\Modules\InstallBG folder

i have found the following lines in the script that I'm assuming need changing:

#if UseInstallBackground
Source: "Resources\Modules\InstallBG\InnoCallback.dll" ; DestDir: "{tmp}"; Flags: dontcopy
Source: "Resources\Modules\InstallBG\IsSlideShow.dll"; DestDir: "{tmp}"; Flags: dontcopy
#sub AddFile2
Source: "Setup\Background\{#i}.jpg"; DestDir: "{tmp}"; Flags: dontcopy
#endsub
#for {i = 1; FileExists("Setup\Background" + Str(i) + ".jpg" ) != 0; i++} AddFile2
#endif

Any help appreciated.

Dragonis40 17-09-2023 04:05

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

Good morning, how to extract the value from the function above?

I've tried:

value.Caption:=StrToInt(GetVolumeFreeSpace);
value.Caption:=FloatToStr(GetVolumeFreeSpace);
value.Caption:=StrToFloat(GetVolumeFreeSpace);

I have "invalid parameters" issue.

How can i fix the problem? Thanks in advance!

Lord.Freddy 17-09-2023 04:59

Quote:

Originally Posted by Dragonis40 (Post 502526)
function GetVolumeFreeSpace(const RootDir: PAnsichar; const OutSizeType: Byte): Double; external 'GetVolumeFreeSpace@files:Isab.dll stdcall delayload';

Good morning, how to extract the value from the function above?

I've tried:

value.Caption:=StrToInt(GetVolumeFreeSpace);
value.Caption:=FloatToStr(GetVolumeFreeSpace);
value.Caption:=StrToFloat(GetVolumeFreeSpace);

I have "invalid parameters" issue.

How can i fix the problem? Thanks in advance!

if you want to get free and total bytes or megabytes on a drive,
Use this function instead.

shazzla 23-09-2023 00:10

hi !

Need a little help here... I tried many combinations ,googled for it ,but no solution. (Standard ISDone)

I want to include/extract some files (XTool-BIK compressor) in my installer and extract them to a sub-folder in {tmp} but the subfolder is not created. Simply all files extracted to the same place ( {tmp} ) ,and it is not good....

Here comes a snippet :

#ifdef xBIK
Source: Include\XToolbpk\_libraries\bik.ini; DestDir: "{tmp}\xBIK\_libraries"; Flags: dontcopy recursesubdirs createallsubdirs
Source: Include\XToolbpk\_libraries\bk2.ini; DestDir: "{tmp}\xBIK\_libraries"; Flags: dontcopy recursesubdirs createallsubdirs
.......


#ifdef xBIK
ExtractTemporaryFile('bik.ini');
ExtractTemporaryFile('bk2.ini');


Whats wrong with my script ?


All times are GMT -7. The time now is 04:08.

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