Skip to content

Commit

Permalink
Readme switching for MultiLang
Browse files Browse the repository at this point in the history
  • Loading branch information
krypto5863 committed Jun 20, 2022
1 parent f21a990 commit 58d9c1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMI/files.iss
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Source: "{#IMisc}\TextureUncensors\lomob\LOmobchara_extra_v1_beta\model\underhai

//Unrelated to files.
Source: "{#IDocumentation}\CMI_Readme.pdf"; DestDir: "{app}\CMI Documentation"; Flags: isreadme nocompression
Source: "{#IDocumentation}\CMI_Readme_Chinese.pdf"; DestDir: "{app}\CMI Documentation"; Flags: isreadme nocompression; Languages: chinesesimplified
//Source: "Documentation\MM_Readme.txt"; DestDir: "{app}\CMI Documentation"; Components:plugins/MM; Flags: isreadme
Source: "{#IDocumentation}\MPS_readme.html"; DestDir: "{app}\CMI Documentation"; Components:bepinexPlugs/meidophoto; Flags: isreadme
Source: "{#IDocumentation}\PosterLoader_Readme.txt"; DestDir: "{app}\CMI Documentation"; Components:plugins/texload/postload; Flags: isreadme
Expand Down
18 changes: 15 additions & 3 deletions code.iss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ var
ErrorCode: Integer;
FreeSpace, TotalSpace: Cardinal;
ManifestVersion: WideString;
VersionResult: Integer;
VersionResult: Integer;
Readme: String;
begin
Log('Initial setup is beginning...');
Expand Down Expand Up @@ -104,9 +105,20 @@ begin
if MsgBox(CustomMessage('ScamWarning') + #13#10#13#10 + CustomMessage('ReadmeRead'), mbConfirmation, MB_YESNO) = IDNO then
begin
MsgBox(CustomMessage('ReadmeExit'), mbCriticalError, MB_OK)
ExtractTemporaryFile('{#ShortName}_Readme.pdf');
if ActiveLanguage = 'chinesesimplified' then
begin
readme := '{#ShortName}_Readme_Chinese.pdf'
end
else
begin
readme := '{#ShortName}_Readme.pdf'
end;
ExtractTemporaryFile(readme);
ShellExecAsOriginalUser('open',
AddQuotes(ExpandConstant('{tmp}\{#ShortName}_Readme.pdf')), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
AddQuotes(ExpandConstant('{tmp}\' + readme)), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
abort
end;
Expand Down

0 comments on commit 58d9c1f

Please sign in to comment.