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

Reply
 
Thread Tools Display Modes
  #1  
Old 19-04-2019, 21:06
dogyutz dogyutz is offline
Registered User
 
Join Date: Sep 2009
Location: Spain
Posts: 26
Thanks: 10
Thanked 3 Times in 1 Post
dogyutz is on a distinguished road
Install Directory

hello all... how to script command of install directory. i want to always install destinationin my patition drive D.
Reply With Quote
Sponsored Links
  #2  
Old 25-04-2019, 03:11
Emorian Emorian is offline
Registered User
 
Join Date: Oct 2011
Location: Hungary
Posts: 16
Thanks: 5
Thanked 2 Times in 2 Posts
Emorian is on a distinguished road
Work: Inno Setup Enhanced Unicode

Write The Setup Section:
Code:
AppName=My Program
AppVersion=5.0
DefaultDirName={code:DefDirWiz}
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=Output
Write the Code section:
Code:
 const
  // GetDriveType
  DRIVE_UNKNOWN     = 0; //UNKNOWN
  DRIVE_NO_ROOT_DIR = 1; //Root path invalid
  DRIVE_REMOVABLE   = 2; //Removable
  DRIVE_FIXED       = 3; //Fixed
  DRIVE_REMOTE      = 4; //Network
  DRIVE_CDROM       = 5; //DVD-ROM and CD-ROM
  DRIVE_RAMDISK     = 6; //Ram disk
 function  GetLogicalDrives: DWord; external '[email protected] stdcall';
 function  GetDriveType(lpRootPathName: AnsiString): UInt; external '[email protected] stdcall';

 Function NoSD: String;
  var
   x, bit, i: Integer;
   tp: Cardinal;
   sd: string;
  Begin
   sd := ExpandConstant('{sd}');
   Result := ExpandConstant('{pf}\');
   x := GetLogicalDrives;
   if x <> 0 then begin
    for i:= 1 to 64 do begin
     bit := x and 1;
     if bit = 1 then begin
      tp := GetDriveType(PAnsiChar(Chr(64 + i) + ':'));
      if tp = DRIVE_FIXED then begin
       if Chr(64 + i) <> Copy(sd, 1, 1) then begin
        Result := Chr(64 + i) + ':\Games\';
        Break;
       end;
      end;
     end;
     x := x shr 1;
    end;
   end;
  End;

 Function _IsWin8: Boolean;
  var
   Version: TWindowsVersion;
  Begin
   GetWindowsVersionEx(Version);
   if ((Version.Major = 6) and (Version.Minor > 1)) or (Version.Major > 6) then begin
    Result := True; end
   else begin
    Result := False;
   end;
  End;

 Function DefDirWiz(s: String): String;
  Begin
   if _IsWin8 then begin
    Result := NoSD() + '{#GameDirName}'; end
   else begin
    Result := ExpandConstant('{pf}\') + '{#GameDirName}';
   end;
  End;
Reply With Quote
  #3  
Old 19-07-2019, 21:29
heihuanlanhun heihuanlanhun is offline
Registered User
 
Join Date: Dec 2017
Location: china
Posts: 26
Thanks: 5
Thanked 1 Time in 1 Post
heihuanlanhun is on a distinguished road
20190719214303.png
when I use the chinese Windows 10 ,it is wrong

what should I do?
Reply With Quote
Reply

Thread Tools
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
How to install the directory automatically points to the Max Drive? 52098994 Conversion Tutorials 16 04-07-2017 20:08
Game install problem MAL1 PC Games 2 12-05-2003 10:21
I need help backing up my original HD, PLEASE!!! devilsminion XBox Games 2 01-05-2003 19:52
Livin' it up install problems slickice PC Games 0 17-02-2002 14:41
Diablo II (backup) install problems... Maketty PC Games 2 03-08-2001 15:22



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


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