Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1531  
Old 11-01-2023, 07:02
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,217
Thanks: 294
Thanked 1,404 Times in 637 Posts
Masquerade is on a distinguished road
^^
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.
Reply With Quote
Sponsored Links
  #1532  
Old 11-01-2023, 21:01
L33THAK0R's Avatar
L33THAK0R L33THAK0R is offline
Registered User
 
Join Date: Feb 2021
Location: Saudi Arabia
Posts: 406
Thanks: 137
Thanked 117 Times in 70 Posts
L33THAK0R is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
^^
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.

Last edited by L33THAK0R; 12-01-2023 at 00:36.
Reply With Quote
  #1533  
Old 31-01-2023, 02:31
Dragonis40 Dragonis40 is online now
Registered User
 
Join Date: Mar 2021
Location: italy
Posts: 70
Thanks: 0
Thanked 3 Times in 3 Posts
Dragonis40 is on a distinguished road
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!
Reply With Quote
  #1534  
Old 05-02-2023, 09:05
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
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!
Attached Files
File Type: rar Project1.rar (293.5 KB, 21 views)
Reply With Quote
  #1535  
Old 10-04-2023, 07:52
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 54
Thanks: 222
Thanked 40 Times in 25 Posts
Lord.Freddy is on a distinguished road
Unhappy 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;
__________________
¤ Life good be a Dream ¤

Last edited by Lord.Freddy; 10-04-2023 at 07:55.
Reply With Quote
  #1536  
Old 10-04-2023, 10:10
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
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)}
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Lord.Freddy (10-04-2023)
  #1537  
Old 10-04-2023, 10:22
Lord.Freddy's Avatar
Lord.Freddy Lord.Freddy is offline
Registered User
 
Join Date: Apr 2022
Location: ...
Posts: 54
Thanks: 222
Thanked 40 Times in 25 Posts
Lord.Freddy is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
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;
__________________
¤ Life good be a Dream ¤
Reply With Quote
  #1538  
Old 29-04-2023, 06:33
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 688
Thanks: 481
Thanked 2,547 Times in 561 Posts
BLACKFIRE69 is on a distinguished road
Question 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.
Reply With Quote
  #1539  
Old 05-05-2023, 01:52
Junior53's Avatar
Junior53 Junior53 is offline
Registered User
 
Join Date: May 2023
Location: Sri Lanka
Posts: 25
Thanks: 23
Thanked 32 Times in 10 Posts
Junior53 is on a distinguished road
Question 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.

Last edited by Junior53; 07-06-2023 at 17:37. Reason: I found the answer myself :)
Reply With Quote
  #1540  
Old 06-05-2023, 14:23
IRAQIGHOST IRAQIGHOST is offline
Registered User
 
Join Date: Jun 2020
Location: Iraq
Posts: 71
Thanks: 42
Thanked 29 Times in 16 Posts
IRAQIGHOST is on a distinguished road
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


what is the wrong that I did?
Reply With Quote
  #1541  
Old 06-05-2023, 16:38
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by IRAQIGHOST View Post
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


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.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
IRAQIGHOST (10-05-2023)
  #1542  
Old 17-05-2023, 14:37
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,684
Thanks: 1,106
Thanked 7,331 Times in 2,834 Posts
KaktoR is on a distinguished road
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" *
__________________
Haters gonna hate
Reply With Quote
  #1543  
Old 17-05-2023, 18:45
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,073
Thanks: 1,814
Thanked 2,302 Times in 786 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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"
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
KaktoR (18-05-2023)
  #1544  
Old 18-05-2023, 01:10
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,684
Thanks: 1,106
Thanked 7,331 Times in 2,834 Posts
KaktoR is on a distinguished road
Thanks this works
__________________
Haters gonna hate
Reply With Quote
  #1545  
Old 18-05-2023, 05:02
shazzla shazzla is offline
Registered User
 
Join Date: Nov 2010
Location: Hunnia
Posts: 292
Thanks: 523
Thanked 102 Times in 78 Posts
shazzla is on a distinguished road
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.)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



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


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