런처 설치 프로그램 이름 설정 방법

작동 방식

런처 설치 프로그램 파일은 기본적으로 독립 실행 형 버전의 경우 installer.exe이고 웹 버전의 경우 web_installer.exe입니다. 웹사이트 코드에서 이름을 설정할 수 있습니다. 사용자가 다운로드 버튼이나 링크를 클릭하면 브라우저가 자동으로 설치 파일의 이름을 교체합니다.

획득 방법

  1. 아래 예시와 같이 웹사이트 코드에 보이지 않는 iframe을 추가하면 그 안에 수정된 이름으로 설치 파일을 다운로드하는 링크가 형성됩니다.

예시:

Copy
Full screen
Small screen
    <body>
      ...
      <script>
        const frame = document.createElement("IFRAME");
        frame.id = "xsolla-installer-renamer";
        frame.src = `https://installer.launcher.xsolla.com/launcher-installer-renamer-prod/v1/renamer.html?cache=${Date.now()}`;
        frame.style = "display: none";
        document.body.append(frame);
      </script>
      ...
    <body>
    

    1. 링크 또는 버튼을 클릭할 때 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
    Full screen
    Small screen
      postMessage(
        {
          type: "download",
          href: "<LINK TO INSTALLER>",
          name: "<NEW INSTALLER NAME>",
        },
        "https://installer.launcher.xsolla.com"
      )
      

      다음은 설치 파일을 다운로드하는 다운로드 링크와 버튼의 예시 코드입니다.

      설치 파일 다운로드 링크의 예시 코드:

      Copy
      Full screen
      Small screen
        <body>
          ...
          <a
              href="#"
              onclick="document.getElementById('xsolla-installer-renamer').contentWindow.postMessage({ type: 'download', href: '<LINK TO INSTALLER>', name: '<NEW INSTALLER NAME>' }, 'https://installer.launcher.xsolla.com');"
          >
            Donwload
          </a>
          ...
        <body>
        

        설치 파일 다운로드 버튼의 예시 코드:

        Copy
        Full screen
        Small screen
          <body>
            ...
            <button id="button-download">Download</button>
            <script>
              const btn = document.getElementById("button-download");
              btn.onclick = () => {
                document
                  .getElementById("xsolla-installer-renamer")
                  .contentWindow.postMessage(
                    {
                      type: "download",
                      href: "<LINK TO INSTALLER>",
                      name: "<NEW INSTALLER NAME>",
                    },
                    "https://installer.launcher.xsolla.com"
                  );
              };
            </script>
            ...
          <body>
          
          이 기사가 도움이 되었나요?
          감사합니다!
          개선해야 할 점이 있을까요? 메시지
          유감입니다
          이 기사가 도움이 안 된 이유를 설명해 주세요. 메시지
          의견을 보내 주셔서 감사드립니다!
          메시지를 검토한 후 사용자 경험 향상에 사용하겠습니다.
          이 페이지 평가
          이 페이지 평가
          개선해야 할 점이 있을까요?

          답하기 원하지 않습니다

          의견을 보내 주셔서 감사드립니다!
          마지막 업데이트: 2024년 1월 22일

          오자 또는 기타 텍스트 오류를 찾으셨나요? 텍스트를 선택하고 컨트롤+엔터를 누르세요.

          문제 보고
          콘텐츠를 항상 검토합니다. 여러분의 피드백은 콘텐츠를 개선에 도움이 됩니다.
          후속 조치를 위해 이메일을 제공해 주세요
          의견을 보내 주셔서 감사드립니다!