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)

shazzla 23-09-2023 08:51

Thanks,but it only creates folders.
How to implement it in my script? (Above)
(Atm im away from my comp,btw tomorrow will try something with it)

shazzla 24-09-2023 00:09

tried. i still cant extract the files there.. ( {tmp}\xBIK )

Any solution ? Anyone ?

Junior53 29-09-2023 16:53

:)
 
Quote:

Originally Posted by Junior53 (Post 501386)
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;


It's Actually 05:20 Am here in sri lanka :o and i finally found the answer to this :) LMAO

Lord.Freddy 27-06-2024 00:09

Hello, yesterday I attempted to create a function in Inno Setup to gather file names and their respective sizes, but only a few files were returned. I am currently at a standstill and unsure of how to proceed. Does anyone know where i went wrong?
Code:

[Setup]
AppName=FindFiles
AppVerName=FindFiles
CreateAppDir=no
OutputDir=.\OutPut
OutputBaseFilename=FindFiles

[_Code]
type
  TAutoString = {#defined(UNICODE) ? "Wide" : ""}String;
  TFileList = array of record
    FileName, FileSize: TAutoString;
  end;

var
  FileList: TFileList;

function Size64(const Hi, Lo: Integer): Extended;
begin
  Result := Lo;
  if (Lo < 0) then
    Result := (Result + $7FFFFFFF + $7FFFFFFF + 2);
  for Hi := (Hi - 1) downto 0 do
    Result := (Result + $7FFFFFFF + $7FFFFFFF + 2);
end;

function FloatToStrEx(const value: Extended): TAutoString;
begin
  Result := FloatToStr(value);
  while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
    SetLength(Result, (Length(Result) - 1));
end;

function FindFilesEx(FolderPath: TAutoString; var FilesList, FileSize: array of TAutoString): Integer;
var
  FindRec: TFindRec;
begin
  Result := 0;
  if FindFirst(ExpandConstant(AddBackslash(FolderPath)) + '*', FindRec) then
  begin
    repeat
      if (FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0) or
        (FindRec.Attributes and FILE_ATTRIBUTE_HIDDEN <> 0) then
      begin
        SetArrayLength(FilesList, Result + 1);
        SetArrayLength(FileSize, Result + 1);
        FilesList[GetArrayLength(FilesList) - 1] := ExpandConstant(AddBackslash(FolderPath)) + FindRec.Name;
        FileSize[GetArrayLength(FileSize) - 1] := FloatToStrEx(Size64(FindRec.SizeHigh, FindRec.SizeLow));
        Result := Result + 1;
      end;
      if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
      begin
        if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
          Result := Result + FindFilesEx(AddBackslash(FolderPath) + FindRec.Name, FilesList, FileSize);
      end;
    until not FindNext(FindRec);
    FindClose(FindRec);
  end;
end;

procedure FindFiles(Dir: TAutoString; var FilesFound: Integer);
var
  TotalFilesFound, Y, S: Integer;
  FilesNameList, FileNameSize: array of TAutoString;
begin
  TotalFilesFound := FindFilesEx(ExpandConstant(Dir), FilesNameList, FileNameSize);
  FilesFound := TotalFilesFound;
  for Y := 0 to totalFilesFound - 1 do
  begin
    SetArrayLength(FileList, GetArrayLength(FileList) + 1);
    S := GetArrayLength(FileList) - 1;
    with FileList[S] do
    begin
      FileList[S].FileName := FilesNameList[Y];
      Delete(FileList[S].FileName, Pos(AddBackslash(Dir), FileList[S].FileName), Length(AddBackslash(Dir)));   
      FileList[S].FileSize := FileNameSize[Y];
    end;     
  end;
end;

function InitializeSetup: Boolean;
var
  TotalFilesFound, I: Integer;
  Dir: TAutoString;
begin
  Dir := ExpandConstant('{src}\..');
  FindFiles(Dir, TotalFilesFound);
  for I := 0 to GetArrayLength(FileList) - 1 do
  begin
    msgbox('FileName: ' + FileList[I].FileName + #13#10 + 'FileSize: ' + FileList[I].FileSize + ' bytes', mbInformation, MB_OK);
  end;
  Result := False;
end;

Update(solution):
I found a solution for the above code, which is as follows.
Code:

[Setup]
AppName=FindFiles
AppVerName=FindFiles
CreateAppDir=no
OutputDir=.\OutPut
OutputBaseFilename=FindFiles

[_Code]
type
  TAutoString = {#defined(UNICODE) ? "Wide" : ""}String;
  TFileList = array of record
    FileName, FileExt, FileSize, FilePath: TAutoString;
  end;

function Size64(const Hi, Lo: Integer): Extended;
begin
  Result := Lo;
  if (Lo < 0) then
    Result := (Result + $7FFFFFFF + $7FFFFFFF + 2);
  for Hi := (Hi - 1) downto 0 do
    Result := (Result + $7FFFFFFF + $7FFFFFFF + 2);
end;

function FloatToStrEx(const value: Extended): TAutoString;
begin
  Result := FloatToStr(value);
  while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
    SetLength(Result, (Length(Result) - 1));
end;

function pFindFiles(const BaseDir, DestDir, FileMask: TAutoString; var OutFileList: TFileList): Integer;
var
  FSR, DSR: TFindRec;
  FindResult: Boolean;
  APath: TAutoString;
  nCount: Integer;
begin
  APath := ExpandConstant(AddBackslash(DestDir));
  FindResult := FindFirst(APath + '*.*', DSR);
  try
    while FindResult do
    begin
      if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and not ((DSR.Name = '.') or (DSR.Name = '..')) then
      begin
        pFindFiles(BaseDir, APath + DSR.Name, FileMask, OutFileList);
      end;
      FindResult := FindNext(DSR);
    end;

    FindResult := FindFirst(APath + FileMask, FSR);

    while FindResult do
    begin
      if (FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0) then
      begin
        SetArrayLength(OutFileList, GetArrayLength(OutFileList) + 1);
        OutFileList[GetArrayLength(OutFileList) - 1].FileName := FSR.Name;       
        OutFileList[GetArrayLength(OutFileList) - 1].FileExt  := ExtractFileExt(FSR.Name);
        OutFileList[GetArrayLength(OutFileList) - 1].FileSize := FloatToStrEx(Size64(FSR.SizeHigh, FSR.SizeLow));
        OutFileList[GetArrayLength(OutFileList) - 1].FilePath := ExtractFilePath(ExtractRelativePath(AddBackslash(BaseDir), APath + FSR.Name));
        nCount := nCount + 1;
      end;
      FindResult := FindNext(FSR);
    end;
  finally
    FindClose(FSR);
    FindClose(DSR);
  end;
  Result := nCount;
end;

function InitializeSetup: Boolean;
var
  TotalFilesFound, I: Integer;
  Dir: TAutoString;
  FileList: TFileList;
  OutList: TAutoString;
begin
  Dir := ExpandConstant('{src}\..');
  TotalFilesFound := pFindFiles(Dir, Dir, '*.*', FileList);
  for I := 0 to GetArrayLength(FileList) - 1 do
  begin
    OutList := OutList + 'FileName: ' + FileList[I].FileName + #13#10 + 'FileSize: ' + FileList[I].FileSize + ' bytes' + #13#10 + 'FileExt: ' + FileList[I].FileExt + #13#10 + 'FilePath: ' + FileList[I].FilePath + #13#10 + #13#10;
  end;
  msgbox(OutList, mbInformation, MB_OK);
  Result := False;
end;


demon964 11-07-2024 03:23

Root: "HKLM"; Subkey: "SOFTWARE\Wow6432Node\KONAMI\PES2013"; ValueType: string; ValueName: "installdir"; ValueData: "{app}{#MyAppExeName}"; Flags: uninsdeletekey

I added this code to my script, but it duplicates Wow6432Node the folder in regedit.

It should be: SOFTWARE\Wow6432Node\KONAMI\PES2013

But it shows: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Wow6432Nod e\KONAMI\PES2013

jakepaulie 29-11-2024 09:51

Hello, i have a problem. When i want to do some repacks it normaly works. But when i want to start the wizard the problem starts. It Normally installs, But not really... It just corrupts the file. Please help me with it

bitsbb01 16-08-2026 19:01

Help with this iss setup, with decompressing 7z
 
1 Attachment(s)
This is edited as figuered it out and got the .iss working and extracting..

bird2026 26-08-2026 10:04

Aliens Fireteam Elite 2 size: 25,48 GB - Compressed game size: 16,95 GB (Ratio 66.52%
 
Aliens Fireteam Elite 2 size: 25,48 GB - Compressed game size: 16,95 GB (Ratio 66.52%-
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------- CONVERSION DATE 2026.08.26 -----------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
00:02:32 - You have chosen the DVD5 type for the media size.
00:02:32 - ISO images will not be created when conversion is complete.
00:02:32 - The computer will shut down when the conversion is complete.
00:02:32 - Selected ARC/DS method for Data1a-01.bin was: xtool:c32mb:d1:mue5,k0x091404DAA65060786C5A9B5D594 43185F2D2C47724E6F1648C0BBBF850AD96C1:mpreflate+xt ool:o:lm3:p:c32mb:t90p:mpreflate:dd3+lolz:dtb1:d17 6:mtt1:mt16:mc1023
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
00:02:33 - Compression initialized in 26.08.2026 at 00:02:33.
00:02:33 - Starting Data1a-01.bin archive creation.
01:45:13 - Moving Data1a-01.bin Data1a-04.bin files to media folder.
01:45:13 - Compression finished in 26.08.2026 at 01:45:13.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
01:45:13 - Getting size of the game: Unknown 1
01:45:13 - Installation folder size: 25,48 GB
01:45:13 - Compressed game size: 16,95 GB (Ratio 66.52%)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
01:45:13 - Overall input size: 25,48 GB
01:45:13 - Overall output size: 16,95 GB (Ratio 66.52%)
01:45:13 - Overall conversion time: 01:42:40
01:45:13 - Overall conversion discs: 4 DVD5
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------


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

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