FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Install Directory (https://fileforums.com/showthread.php?t=102746)

dogyutz 19-04-2019 21:06

Install Directory
 
hello all... how to script command of install directory. i want to always install destinationin my patition drive D.

Emorian 25-04-2019 03:11

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;


heihuanlanhun 19-07-2019 21:29

1 Attachment(s)
Attachment 25090
when I use the chinese Windows 10 ,it is wrong

what should I do?


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

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