Play में मैनेज करके पब्लिश करने की सुविधा

इस दस्तावेज़ में बताया गया है कि Play की मैनेज की गई इंस्टॉलेशन सुविधा का इस्तेमाल करके, Google Play Games on PC पर गेम कैसे पब्लिश करें.

Play की मैनेज की गई इंस्टॉलेशन सुविधा की मदद से, Google Play गेम को इंस्टॉल, अपडेट, और अनइंस्टॉल करने की प्रोसेस को मैनेज करता है. इसके लिए, वह गेम की फ़ाइलों और मेटाडेटा का इस्तेमाल करता है. यह मेटाडेटा, Windows ऐप्लिकेशन बंडल (WAB) फ़ाइल में मौजूद होता है.

शुरू करने से पहले

अपने गेम में Google Play Games SDK को इंटिग्रेट करें.

अपने गेम को WAB फ़ाइल के तौर पर पैकेज करना

Play की ओर से मैनेज किए जाने वाले इंस्टॉलेशन की WAB फ़ाइल बनाने के लिए, यह तरीका अपनाएं:

  1. Play पब्लिशिंग टूल डाउनलोड करें. इस टूल को Windows कमांड लाइन या Powershell पर चलाया जा सकता है.

  2. Play पर पब्लिश करने के लिए कॉन्फ़िगरेशन फ़ाइल बनाएं. इसका कोई भी नाम रखा जा सकता है. उदाहरण के लिए, play_publishing_config.xml इस फ़ॉर्मैट में:

    <?xml version="1.0" encoding="UTF-8"?>
    <play-publishing-config version="1.0">
      <!-- Application metadata: This section contains basic information about your game. -->
      <application>
        <package-name>PACKAGE_NAME</package-name>
        <version-name>VERSION_NAME</version-name>
      </application>
    
      <!-- Game files: This section specifies which game files to include in the bundle and how to treat them. -->
      <game-files>
        <file-set>
          <root-folder-path>PATH_TO_ROOT_FOLDER</root-folder-path>
          <!-- absolute or relative to the parent directory of the config xml -->
          <!-- Exclusions: A list of files or folders to exclude from the bundle.
               This is useful for removing development files, temporary data, or redundant assets. -->
          <exclusions>
            <file-path>REGEX_PATTERN_OF_EXCLUDED_FILES</file-path>
            <file-path>PATH_TO_BE_EXCLUDED</file-path>
          </exclusions>
    
          <!-- File attributes: Define special handling for certain files during installation and updates. -->
          <file-attribute value=FILE_ATTRIBUTE_VALUE>
            <file-path>PATH_TO_FILE</file-path>
            <file-path>REGEX_PATTERN_OF_FILE_ATTRIBUTE_FILES</file-path>
          </file-attribute>
        </file-set>
      </game-files>
    
      <!-- This file represents the startup process for this game. Google Play Games for PC should start
          this process when user clicks on "Play" on this game. -->
      <launch-command>
        <path>PATH_TO_LAUNCH_FILE</path>
        <arguments>ARGUMENTS</arguments>
      </launch-command>
    
      <!-- Lifecycle operations: Custom actions to be performed during the game's installation and uninstallation. -->
      <lifecycle-operations>
        <!-- Install operations: These actions run when the game is installed. 'requiresElevation="true"'
            will trigger a UAC prompt for administrator rights. There are three types of install
            operations that can be specified. An instance of each is listed below. -->
        <install-operation requiresElevation=INSTALL_OPERATION_REQUIRES_ELEVATION>
          <operation-identifier>OPERATION_IDENTIFIER_STRING</operation-identifier>
          <execute-file>
            <path>PATH_TO_INSTALL_EXECUTE_FILE</path>
            <arguments>ARGUMENTS</arguments>
          </execute-file>
        </install-operation>
    
        <install-operation requiresElevation=INSTALL_OPERATION_REQUIRES_ELEVATION>
          <operation-identifier>OPERATION_IDENTIFIER_STRING</operation-identifier>
          <update-registry baseKey=BASE_KEY>
            <sub-key>SUB_KEY_PATH</sub-key>
            <value-name>VALUE_NAME</value-name>
            <value type=REGISTRY_VALUE_TYPE>VALUE_TEXT</value>
          </update-registry>
        </install-operation>
    
        <!-- Uninstall operations: These actions run before the game is uninstalled. -->
        <uninstall-operation requiresElevation=UNINSTALL_OPERATION_REQUIRES_ELEVATION>
          <execute-file>
            <path>PATH_TO_UNINSTALL_EXECUTE_FILE</path>
            <arguments>ARGUMENTS</arguments>
          </execute-file>
        </uninstall-operation>
      </lifecycle-operations>
    </play-publishing-config>

    इनकी जगह ये डालें:

    • PACKAGE_NAME: आपके गेम के पैकेज का नाम. यह यूनीक आइडेंटिफ़ायर, Google Play पर आपके गेम से जुड़ा होगा. उदाहरण के लिए, com.yourcompany.yourgame. पैकेज का नाम, इन नियमों के मुताबिक होना चाहिए:
      • इसमें कम से कम दो सेगमेंट (एक या उससे ज़्यादा बिंदु) होने चाहिए.
      • हर सेगमेंट की शुरुआत किसी अक्षर से होनी चाहिए.
      • सभी वर्ण, अक्षर और अंक या अंडरस्कोर ([a-zA-Z0-9_]) होने चाहिए.
    • VERSION_NAME: गेम के वर्शन की स्ट्रिंग. यह कोई भी स्ट्रिंग हो सकती है. हालांकि, यह आपके गेम के लिए अपलोड किए गए सभी WAB में यूनीक होनी चाहिए. उदाहरण के लिए: 1.0, 1.0.1-beta, 2025.11.24, v1.rc1.
    • PATH_TO_ROOT_FOLDER: गेम की फ़ाइलें रखने वाले रूट फ़ोल्डर का पाथ. इस फ़ोल्डर में मौजूद सभी फ़ाइलों को बंडल में जोड़ा जाता है. हालांकि, इसमें वे फ़ाइलें शामिल नहीं होती हैं जिन्हें बाहर रखा गया है. यह पाथ, play_publishing_config.xml फ़ाइल वाली डायरेक्ट्री के हिसाब से ऐब्सलूट या रिलेटिव हो सकता है.

    • exclusions: (ज़रूरी नहीं) PATH_TO_ROOT_FOLDER में मौजूद फ़ाइलों के लिए फ़ाइल पाथ या पैटर्न तय करता है, ताकि उन्हें बंडल से हटाया जा सके. exclusions एलिमेंट में एक से ज़्यादा file-path एलिमेंट शामिल किए जा सकते हैं. पाथ को इन दो तरीकों में से किसी एक तरीके से दिखाया जा सकता है:

      • फ़ाइल पाथ के तौर पर: वह फ़ाइल पाथ जिसे शामिल नहीं करना है.
      • रेगुलर एक्सप्रेशन स्ट्रिंग के तौर पर: रेगुलर एक्सप्रेशन स्ट्रिंग से मैच करने वाली सभी फ़ाइलों को बंडल से बाहर रखा जाता है. RE2 सिंटैक्स का इस्तेमाल करें.
    • file-attribute: (ज़रूरी नहीं) यह किसी खास फ़ाइल या रेगुलर एक्सप्रेशन पैटर्न से मेल खाने वाली फ़ाइलों के लिए एट्रिब्यूट तय करता है.

      • FILE_ATTRIBUTE_VALUE: इनमें से कोई एक स्थिति हो सकती है:
        • SKIP_UPDATE: अपडेट के दौरान, यह एट्रिब्यूट सिस्टम को बताता है कि फ़ाइल को सिर्फ़ तब कॉपी किया जाए, जब वह पहले से मौजूद न हो. इससे मौजूदा फ़ाइल में किए गए बदलाव सुरक्षित रहते हैं.
        • MODIFIED_ON_DEVICE: इसका इस्तेमाल उन फ़ाइलों के लिए करें जिन्हें अपडेट करना ज़रूरी है. हालांकि, इंस्टॉल करने के बाद डिवाइस पर उनमें बदलाव किया जा सकता है. अपडेट के दौरान, सिस्टम पूरी नई फ़ाइल डाउनलोड करता है और इंस्टॉल किए गए वर्शन को बदल देता है. अगर इंस्टॉलेशन की इंटिग्रिटी की जांच के दौरान, यह फ़ाइल इंस्टॉल किए गए वर्शन से अलग होती है, तो इंस्टॉलेशन को खराब नहीं माना जाता.
      • file-path: इस एट्रिब्यूट के लिए फ़ाइलों की पहचान करता है. आपके पास हर file-attribute एलिमेंट में एक से ज़्यादा file-path एलिमेंट शामिल करने का विकल्प होता है. हर पाथ को इन दो तरीकों में से किसी एक तरीके से दिखाया जा सकता है:
        • फ़ाइल पाथ के तौर पर: इस एट्रिब्यूट को जिस फ़ाइल से जोड़ना है उसका पाथ.
        • रेगुलर एक्सप्रेशन स्ट्रिंग के तौर पर: रेगुलर एक्सप्रेशन स्ट्रिंग से मेल खाने वाली सभी फ़ाइलें, एट्रिब्यूट वैल्यू से जुड़ी होती हैं. RE2 सिंटैक्स का इस्तेमाल करें.
    • PATH_TO_LAUNCH_FILE: गेम लॉन्च करने के लिए इस्तेमाल की जाने वाली, एक्ज़ीक्यूटेबल फ़ाइल का पाथ.

    • ARGUMENTS: (ज़रूरी नहीं) कमांड-लाइन आर्ग्युमेंट. <arguments> एलिमेंट का इस्तेमाल, <launch-command>, <install-operation> या <uninstall-operation> में बताई गई एक्ज़ीक्यूटेबल फ़ाइल को आर्ग्युमेंट पास करने के लिए किया जाता है. <arguments> एलिमेंट का हर इस्तेमाल, सिर्फ़ उस एक्ज़ीक्यूटेबल पर लागू होता है जिसके साथ इसे तय किया गया है. इससे, अलग-अलग एक्ज़ीक्यूटेबल के लिए अलग-अलग आर्ग्युमेंट तय किए जा सकते हैं.

      • अगर किसी एक्ज़ीक्यूटेबल में एक से ज़्यादा आर्ग्युमेंट हैं, तो उन्हें स्पेस से अलग करें.
      • अगर एक्ज़ीक्यूटेबल के लिए इसकी ज़रूरत है, तो आर्ग्युमेंट से पहले -- या - जोड़ें. उदाहरण:
        <arguments>--package_name --version_name</arguments>
    • lifecycle-operations: (ज़रूरी नहीं) गेम इंस्टॉल या अनइंस्टॉल करने के दौरान की जाने वाली कस्टम कार्रवाइयां.

      • install-operation: गेम इंस्टॉल होने पर चलाने के लिए एक कार्रवाई. इंस्टॉल करने के दो तरह के ऑपरेशन तय किए जा सकते हैं: execute-file और update-registry.
      • uninstall-operation: गेम को अनइंस्टॉल करने से पहले की जाने वाली कार्रवाई. अनइंस्टॉल करने के दौरान, update-registry कार्रवाइयां अपने-आप पहले जैसी हो जाती हैं.
      • INSTALL_OPERATION_REQUIRES_ELEVATION: इससे पता चलता है कि इंस्टॉल करने की प्रोसेस को एडमिन के अधिकारों के साथ चलाना है या नहीं.

        • "true": एडमिन के तौर पर चलाएं.
        • "false": इसे मौजूदा उपयोगकर्ता के तौर पर चलाएं. अगर इस विकल्प को नहीं चुना जाता है, तो यह डिफ़ॉल्ट रूप से लागू होता है.
      • UNINSTALL_OPERATION_REQUIRES_ELEVATION: इससे पता चलता है कि अनइंस्टॉल करने की प्रोसेस को एडमिन के अधिकारों के साथ चलाना है या नहीं.

        • "true": एडमिन के तौर पर चलाएं.
        • "false": इसे मौजूदा उपयोगकर्ता के तौर पर चलाएं. अगर इस विकल्प को नहीं चुना जाता है, तो यह डिफ़ॉल्ट रूप से लागू होता है.
      • operation-identifier: install-operation की पहचान करने के लिए यूनीक स्ट्रिंग.

      • execute-file: किसी फ़ाइल को रन करने के लिए निर्देश देता है.

        • PATH_TO_INSTALL_EXECUTE_FILE: इंस्टॉलेशन के दौरान चलाने के लिए, एक्ज़ीक्यूटेबल का पाथ.
        • PATH_TO_UNINSTALL_EXECUTE_FILE: अनइंस्टॉल करने से पहले चलाने के लिए, एक्ज़ीक्यूटेबल का पाथ.
      • update-registry: यह Windows रजिस्ट्री एंट्री बनाता है या उसे अपडेट करता है.

        • BASE_KEY: Windows रजिस्ट्री में इस्तेमाल किए जाने वाले रूट की के बारे में बताता है. स्वीकार की गई वैल्यू: HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_PERFORMANCE_DATA, और HKEY_USERS. update-registry ऑपरेशन करते समय, इस्तेमाल किए गए baseKey के आधार पर, पैरंट install-operation पर requiresElevation="true" सेट करें:
          • HKEY_LOCAL_MACHINE या HKEY_CURRENT_CONFIG: requiresElevation="true" को सेट करें.
          • HKEY_CURRENT_USER: requiresElevation="true" की ज़रूरत नहीं है.
          • HKEY_CLASSES_ROOT: requiresElevation="true" को सिर्फ़ तब सेट करें, जब मशीन-वाइड सेक्शन में लिखा जा रहा हो. उपयोगकर्ता के हिसाब से सेक्शन के लिए इसकी ज़रूरत नहीं होती.
          • HKEY_USERS: इसमें सभी उपयोगकर्ताओं की प्रोफ़ाइलें होती हैं. मौजूदा उपयोगकर्ता के अलावा, अन्य उपयोगकर्ताओं की प्रोफ़ाइल में बदलाव करते समय requiresElevation="true" सेट करें. उदाहरण के लिए, अन्य उपयोगकर्ता या .DEFAULT.
        • SUB_KEY_PATH: यह Windows Registry में मौजूद किसी खास कुंजी का पाथ दिखाता है. यह मुख्य baseKey के तहत नेस्ट की गई होती है.
        • VALUE_NAME: इससे उस डेटा एंट्री का नाम पता चलता है जिसमें आपको तय की गई सब-की के अंदर बदलाव करना है.
        • REGISTRY_VALUE_TYPE: यह एट्रिब्यूट, रजिस्ट्री में लिखी जा रही वैल्यू के डेटा टाइप के बारे में बताता है. STRING को स्ट्रिंग के लिए या DWORD को 32-बिट नंबर के लिए इस्तेमाल किया जा सकता है.
        • VALUE_TEXT: रजिस्ट्री की में सेव किया जाने वाला डेटा.

    रेगुलर एक्सप्रेशन का इस्तेमाल कैसे करें

    फ़ाइलों के किसी ग्रुप पर, फ़ाइल एट्रिब्यूट लागू करने या उन्हें बाहर रखने के लिए, file-pathटैग में RE2 सिंटैक्स रेगुलर एक्सप्रेशन का इस्तेमाल किया जा सकता है. ध्यान रखें कि डायरेक्ट्री सेपरेटर के लिए, फ़ॉरवर्ड स्लैश / का इस्तेमाल करें. साथ ही, रेगुलर एक्सप्रेशन के खास वर्णों को एस्केप करने के लिए, बैकस्लैश \ का इस्तेमाल करें. उदाहरण के लिए, लिटरल डॉट . से मैच करने के लिए \. का इस्तेमाल करें या किसी अंक से मैच करने के लिए \d का इस्तेमाल करें.

    यहां कुछ सामान्य उदाहरण दिए गए हैं:

    • किसी भी डायरेक्ट्री में, किसी खास एक्सटेंशन (उदाहरण के लिए, .log) वाली सभी फ़ाइलों से मेल खाना

      .*\.log का इस्तेमाल करके, .log पर खत्म होने वाले किसी भी पाथ से मेल खाएं. जैसे, game.log या logs/errors.log.

      <file-path>.*\.log</file-path>
    • किसी फ़ोल्डर (उदाहरण के लिए, 'temp') में मौजूद सभी फ़ाइलों और सबडायरेक्ट्री से मेल खाना

      temp/.* का इस्तेमाल करके, temp/ से शुरू होने वाले सभी पाथ से मैच करें. जैसे, temp/data.txt या temp/saves/file.sav.

      <file-path>temp/.*</file-path>
    • किसी फ़ोल्डर में मौजूद, पैटर्न से मेल खाने वाली फ़ाइलों का पता लगाना

      assets/level1.dat और assets/level2.dat से मेल खाने के लिए, assets/level\d\.dat का इस्तेमाल करें. हालांकि, assets/other.dat से मेल खाने के लिए इसका इस्तेमाल न करें.

      <file-path>assets/level\d\.dat</file-path>
    • पाथ में कहीं भी दिखने वाले फ़ोल्डर के नाम से मेल खाना

      .*/cache/.* का इस्तेमाल करके, cache नाम वाली किसी भी डायरेक्ट्री में मौजूद फ़ाइलों से मैच करें. जैसे, game/cache/file.txt या temp/cache/other.log.

      <file-path>.*/cache/.*</file-path>
    • कई एक्सटेंशन वाली फ़ाइलों का मिलान करना (उदाहरण के लिए, .ini, .cfg, .sav)

      .*\.(ini|cfg|sav) का इस्तेमाल करके, .ini, .cfg या .sav से खत्म होने वाली किसी भी फ़ाइल को मैच किया जा सकता है. जैसे, settings.ini, config.cfg या saves/slot1.sav.

      <file-path>.*\.(ini|cfg|sav)</file-path>
    • किसी खास डायरेक्ट्री में, किसी खास एक्सटेंशन वाली फ़ाइलों से मेल खाना (उदाहरण के लिए, music/ या sfx/ में .ogg)

      (music|sfx)/.*\.ogg का इस्तेमाल करके, .ogg फ़ाइलों से मैच करें. ये फ़ाइलें, music/ या sfx/ डायरेक्ट्री में मौजूद होनी चाहिए, लेकिन किसी और डायरेक्ट्री में नहीं. music/level1.ogg या sfx/explosion.ogg से मेल खाता है, लेकिन voice/intro.ogg से नहीं.

      <file-path>(music|sfx)/.*\.ogg</file-path>

    Play पर पब्लिश करने की कॉन्फ़िगरेशन फ़ाइल का उदाहरण

    यहां TestGame नाम के गेम के लिए play_publishing_config.xml का एक उदाहरण दिया गया है:

    <?xml version="1.0" encoding="UTF-8"?>
    <play-publishing-config version="1.0">
      <application>
        <package-name>com.test.package</package-name>
        <version-name>1.0</version-name>
      </application>
    
      <game-files>
        <file-set>
          <root-folder-path>C:\Users\Username\game-files</root-folder-path>
          <exclusions>
            <file-path>mock_game\d\.exe</file-path> <!-- exclude files using a regex -->
            <file-path>deprecated_graphics</file-path> <!-- exclude a folder -->
            <file-path>.*\.log</file-path> <!-- recursively exclude all files with .log extension -->
          </exclusions>
    
          <file-attribute value="SKIP_UPDATE">
            <file-path>settings.ini</file-path>
          </file-attribute>
    
          <file-attribute value="MODIFIED_ON_DEVICE">
            <file-path>game_assets\d\.zip</file-path> <!-- define the path using regex -->
          </file-attribute>
        </file-set>
      </game-files>
    
      <launch-command>
        <path>launcher_test_game.exe</path>
        <arguments>--launch-arg</arguments> <!-- optional -->
      </launch-command>
    
      <lifecycle-operations>
        <install-operation requiresElevation="true">
          <operation-identifier>elevated-execute-file</operation-identifier>
          <execute-file>
            <path>install_file.exe</path>
            <arguments>--arg</arguments> <!-- optional -->
          </execute-file>
        </install-operation>
    
        <install-operation requiresElevation="true">
          <operation-identifier>elevated-update-registry</operation-identifier>
          <update-registry baseKey="HKEY_LOCAL_MACHINE">
            <sub-key>SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\TestGame</sub-key>
            <value-name>InstallLocation</value-name>
            <value type="STRING">C:\Program Files\TestGame</value>
          </update-registry>
        </install-operation>
    
        <uninstall-operation requiresElevation="true">
          <execute-file>
            <path>uninstall.exe</path>
            <arguments>--test-arg</arguments> <!-- optional -->
          </execute-file>
        </uninstall-operation>
      </lifecycle-operations>
    </play-publishing-config>
  3. build-bundle कमांड का इस्तेमाल करके, Windows कमांड लाइन या Powershell पर Play पब्लिशिंग टूल चलाएं:

    playpublishingtool.exe build-bundle --input=PLAY_PUBLISHING_CONFIG_PATH --output=WAB_OUTPUT_PATH
    

    अगर आपको एक ही नाम वाली मौजूदा WAB फ़ाइल को बदलना है, तो --force आर्ग्युमेंट का इस्तेमाल करें.

    playpublishingtool.exe build-bundle --input=PLAY_PUBLISHING_CONFIG_PATH --output=WAB_OUTPUT_PATH --force
    

    इनकी जगह ये डालें:

    • PLAY_PUBLISHING_CONFIG_PATH: Play पब्लिशिंग कॉन्फ़िगरेशन का पाथ. उदाहरण के लिए, path\to\play_publishing_config.xml.
    • WAB_OUTPUT_PATH: WAB फ़ाइल का पाथ. उदाहरण के लिए, path\to\output_bundle.wab.

    Play पब्लिशिंग टूल इस्तेमाल करने का तरीका

    अगर आपके पास playpublishingtool.exe, play_publishing_config.xml, और मौजूदा वर्किंग डायरेक्ट्री में game_files/ में मौजूद गेम फ़ाइलें हैं, तो:

    .\
    ├── game_files/
    ├── play_publishing_config.xml
    ├── playpublishingtool.exe
    

    उसी डायरेक्ट्री में pmi_bundle.wab बनाने के लिए, यह कमांड चलाएं:

    playpublishingtool.exe build-bundle --input=play_publishing_config.xml --output=pmi_bundle.wab
    

    टूल के बंडल बनाने के दौरान, आपको टर्मिनल पर एक प्रोग्रेस बार दिखेगा:

    Building bundle: [====       ] 40%
    

    सफल होने पर, आपको कुछ ऐसा आउटपुट दिखेगा:

    Building bundle: [===========] 100%
    Successfully built the managed install bundle at pmi_bundle.wab
    

    WAB फ़ाइल को इस फ़ोल्डर में ढूंढें:

      .\
      ├── game_files/
      ├── pmi_bundle.wab
      ├── play_publishing_config.xml
      ├── playpublishingtool.exe