Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-11-2021, 09:31
giruthanders giruthanders is offline
Registered User
 
Join Date: Oct 2021
Location: Japan
Posts: 3
Thanks: 1
Thanked 1 Time in 1 Post
giruthanders is on a distinguished road
Remember Default Installation Directory

Hello, I would like to ask how I could make the setup remember the folder I install my games in, like FitGirl's?

The default is C:\Program Files, but for example I change it to D:\Games. I want the installer to remember so that the next game I install, it will default to that directory instead of going back to C.
Reply With Quote
Sponsored Links
  #2  
Old 02-11-2021, 09:12
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by giruthanders View Post
Hello, I would like to ask how I could make the setup remember the folder I install my games in, like FitGirl's?

The default is C:\Program Files, but for example I change it to D:\Games. I want the installer to remember so that the next game I install, it will default to that directory instead of going back to C.
FitGirl installers look for the next drive other than the drive the system is installed on and always install the game in a "Games" subfolder.
It doesn't memorize your last choice, it always installs in a "Games" folder and on the same drive.
Even if you choose "E:\My Games", assuming the system is installed on the "C:" drive in the next install it will suggest "D:\Games" as in the first install (Correct me if I'm wrong).

If you want similar behavior change the line in the [Setup] section of the script.
Code:
from:
DefaultDirName={#DefaultDir}\{#GameName}

to:
DefaultDirName={code:NoSD}\Games\{#GameName}
Then paste this code below into the [ Code] section of the script.
Code:
const
  DRIVE_FIXED = 3;

function GetLogicalDriveStrings(nLenDrives: DWORD; lpDrives: String): DWORD;
  external '[email protected] stdcall delayload';

function GetDriveType(lpDisk: String): DWORD;
  external '[email protected] stdcall delayload';

function NoSD(Param: String): String;
var
  Drive: String;
  Buffer: String;
begin
  SetLength(Buffer, 255);
  SetLength(Buffer, GetLogicalDriveStrings(254, Buffer));
  Result := ExpandConstant('{sd}');
  while Pos(#0, Buffer) > 0 do
  begin
    Drive := Copy(Buffer, 1, Pos(#0, Buffer) - 1);
    if (GetDriveType(Drive) = DRIVE_FIXED) and (CompareText(Drive, ExpandConstant('{sd}\')) <> 0) then
    begin
      Result := RemoveBackslash(Drive);
      Break;
    end;
    Delete(Buffer, 1, Pos(#0, Buffer));
  end;
end;
I hope that's what you need.

Last edited by Cesar82; 02-11-2021 at 09:25.
Reply With Quote
The Following 2 Users Say Thank You to Cesar82 For This Useful Post:
Gehrman (03-11-2021), giruthanders (05-11-2021)
Reply

Tags
asis, ciu, inno, installer, ultraarc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Help] need Advanced Installer script with Razor1911's UltraArc module rez3vil Conversion Tutorials 3 15-04-2024 02:24
Ultimate Conversion Compressor (UCC) vollachr Conversion Tutorials 55 26-04-2021 09:27
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
How many forum members does it take to change a light bulb? rms2001 XBox Games 6 12-01-2004 05:31



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


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