런처 설치 프로그램 이름 설정 방법
작동 방식
런처 설치 프로그램 파일은 기본적으로 독립 실행 형 버전의 경우 installer.exe
이고 웹 버전의 경우 web_installer.exe
입니다. 웹사이트 코드에서 이름을 설정할 수 있습니다. 사용자가 다운로드 버튼이나 링크를 클릭하면 브라우저가 자동으로 설치 파일의 이름을 교체합니다.
획득 방법
- 아래 예시와 같이 웹사이트 코드에 보이지 않는 iframe을 추가하면 그 안에 수정된 이름으로 설치 파일을 다운로드하는 링크가 형성됩니다.
예시:
Copy
1<body>
2 ...
3 <script>
4 const frame = document.createElement("IFRAME");
5 frame.id = "xsolla-installer-renamer";
6 frame.src = `https://installer.launcher.xsolla.com/launcher-installer-renamer-prod/v1/renamer.html?cache=${Date.now()}`;
7 frame.style = "display: none";
8 document.body.append(frame);
9 </script>
10 ...
11<body>
- 링크 또는 버튼을 클릭할 때 iframe에 매개변수를 전달하는
postMessage()
메소드 구현하기:<LINK TO INSTALLER>
- 설치 파일의 URL. 런처 > 설정 > 런처 빌드 섹션의 계시자 계정에있습니다. 예시:https://installer.launcher.xsolla.com/xlauncher-builds/xsolla-launcher-update/123456789/bin/web_installer.exe
<NEW INSTALLER NAME>
- 설치 파일의 이름
예시:
Copy
1postMessage(
2 {
3 type: "download",
4 href: "<LINK TO INSTALLER>",
5 name: "<NEW INSTALLER NAME>",
6 },
7 "https://installer.launcher.xsolla.com"
8)
다음은 설치 파일을 다운로드하는 다운로드 링크와 버튼의 예시 코드입니다.
설치 파일 다운로드 링크의 예시 코드:
Copy
1<body>
2 ...
3 <a
4 href="#"
5 onclick="document.getElementById('xsolla-installer-renamer').contentWindow.postMessage({ type: 'download', href: '<LINK TO INSTALLER>', name: '<NEW INSTALLER NAME>' }, 'https://installer.launcher.xsolla.com');"
6 >
7 Donwload
8 </a>
9 ...
10<body>
설치 파일 다운로드 버튼의 예시 코드:
Copy
1<body>
2 ...
3 <button id="button-download">Download</button>
4 <script>
5 const btn = document.getElementById("button-download");
6 btn.onclick = () => {
7 document
8 .getElementById("xsolla-installer-renamer")
9 .contentWindow.postMessage(
10 {
11 type: "download",
12 href: "<LINK TO INSTALLER>",
13 name: "<NEW INSTALLER NAME>",
14 },
15 "https://installer.launcher.xsolla.com"
16 );
17 };
18 </script>
19 ...
20<body>
이 기사가 도움이 되었나요?
의견을 보내 주셔서 감사드립니다!
메시지를 검토한 후 사용자 경험 향상에 사용하겠습니다.오자 또는 기타 텍스트 오류를 찾으셨나요? 텍스트를 선택하고 컨트롤+엔터를 누르세요.