Quote:
Originally Posted by HunterEmrah
how to automatically uncheck and disable the checkbox of optional/selective component if file doesn't exist. for eg:
i have only 1 language pack from 5, installer should check availability for all of components and automatically uncheck&disable which are missing
another question, maybe not last. how to integrate INIFile function which changes player name in steam_emu.ini after install, to Language changing? For eg:
During installation i will check English language and after install installer will change "Language=spanish" string to "Language=english" in steam_emu.ini.
In this way, it will be more useful for users if we automate the script. I really loved this script.
|
For your first problem maybe this will work (If the installer has only one disk).
Code:
procedure CurPageChanged(CurPageID: integer);
var
I: Integer;
CompFile: String;
begin
//...
if CurPageID = wpWelcome then
begin
//....
#if UseComponents == "1"
if ComponentsPageAvai then
begin
for I := 0 to GetArrayLength(CompIndexList) - 1 do
begin
CompFile := GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.File', '', ExpandConstant('{tmp}\Settings.ini'));
if (ExtractFileExt(CompFile) <> '') and (not FileExists(ExpandConstant('{src}\' + CompFile))) then
begin
ComponentsList.Checked[CompIndexList[I]] := False;
ComponentsList.ItemEnabled[CompIndexList[I]] := False;
end;
end;
end;
#endif
end;
//...
//...
end;
To how to integrate INIFile function, ask kaktor to enter the function for this.
Or you can add the code copying from the CIU v3 (Custom Installer Ultimate) script here in the forum (just over 100 lines of code).
To adapt the code you only need change languages of the code and also the GetValStr for the Settings.ini.