Search Unity

Unity License command line arguments don't work

Discussion in 'Editor & General Support' started by TaminoTeam6, Jan 11, 2019.

  1. TaminoTeam6

    TaminoTeam6

    Joined:
    Nov 14, 2018
    Posts:
    4
    Hello,

    I'm currently trying to include the PS4 build of our game into our automated build process.
    However, changing the license to the PS4 one using command line arguments doesn't work.

    I created the following batchfile:

    cd %~dp0
    set BuildStep=%1
    set Serial=
    IF [%BuildStep%] == [setLicense] (
    set Serial=-serial **-****-****-****-****-****
    echo Switched Unity License to PS4 one
    )
    IF [%BuildStep%] == [removeLicense] (
    set Serial=-serial **-****-****-****-****-****
    echo Switched Unity License to general one
    )
    "C:\Program Files\Unity\Editor\Unity.exe" -quit -batchmode -returnlicense -username "*****@****.com" -password ******
    echo returned license
    "C:\Program Files\Unity\Editor\Unity.exe" -quit %Serial% -batchmode -username "*****@****.com" -password ******

    Returning the license works. However setting the new one does not.
    The log outputs the following:
    Initiating legacy licensing moduleBatchMode: Unity has not been activated with a valid License. Could be a new activation or renewal...

    (Filename: C:/buildslave/unity/build/Platforms/Windows/Modules/LicensingLegacy/WinILicensingAdapter.cpp Line: 43)
    DisplayProgressbar: Unity license
    LICENSE SYSTEM [2019111 15:14:11] Starting license activation with account *****@****.com
    LICENSE SYSTEM [2019111 15:14:11] Opening https://license.unity3d.com/update/poll?cmd=9&tx_id=1805c48f8756bb04d8054a536ba2a6d6&(serial removed)
    LICENSE SYSTEM [2019111 15:14:11] Posting <?xml version="1.0" encoding="UTF-8"?><root><SystemInfo><IsoCode>en</IsoCode><UserName>BuildPC</UserName><OperatingSystem>Windows 10 (10.0.0) 64bit</OperatingSystem><OperatingSystemNumeric>1000</OperatingSystemNumeric><ProcessorType>AMD Ryzen 7 1700X Eight-Core Processor </ProcessorType><ProcessorSpeed>3394</ProcessorSpeed><ProcessorCount>16</ProcessorCount><ProcessorCores>8</ProcessorCores><PhysicalMemoryMB>32701</PhysicalMemoryMB><ComputerName>BUILDPC</ComputerName><ComputerModel>System Product Name (System manufacturer)</ComputerModel><UnityVersion>2018.3.0f2</UnityVersion><SupportedLicenseVersion>6.x</SupportedLicenseVersion></SystemInfo><License id="Terms"><MachineID Value="mweMG/ce0YSgfukLssEA8Ib+XdM=" /><MachineBindings><Binding Key="1" Value="00330-50320-95121-AAOEM" /><Binding Key="2" Value="00523_58_217053_1A.F" /><Binding Key="4" Value="U3lzdGVtIFNlcmlhbCBOdW1iZXI=" /><Binding Key="5" Value="60:45:cb:9d:a1:2e" /></MachineBindings><UnityVersion Value="2018.3.0f2" /></License></root>
    LICENSE SYSTEM [2019111 15:14:15] Received https://license.unity3d.com/update/poll?cmd=9&tx_id=1805c48f8756bb04d8054a536ba2a6d6&(serial removed)
    LICENSE SYSTEM [2019111 15:14:15] Headers:
    HTTP/1.1 200 OK
    X-RX: GEN-cf158301-3b15-4544-873f-5153ab187449
    sc-request-id: e9a246e1-e00d-4c92-8bdb-c9e7f4d72106
    Vary: Accept-Encoding
    sc-token-expires-in: 129
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0
    Content-Type: text/plain
    Date: Fri, 11 Jan 2019 14:14:14 GMT
    Content-Length: 200

    LICENSE SYSTEM [2019111 15:14:15] Opening https://activation.unity3d.com/license.fcgi?CMD=9&TX=1805c48f8756bb04d8054a536ba2a6d6&RX=GEN-cf158301-3b15-4544-873f-5153ab187449
    LICENSE SYSTEM [2019111 15:14:15] Posting <?xml version="1.0" encoding="UTF-8"?><root><SystemInfo><IsoCode>en</IsoCode><UserName>BuildPC</UserName><OperatingSystem>Windows 10 (10.0.0) 64bit</OperatingSystem><OperatingSystemNumeric>1000</OperatingSystemNumeric><ProcessorType>AMD Ryzen 7 1700X Eight-Core Processor </ProcessorType><ProcessorSpeed>3394</ProcessorSpeed><ProcessorCount>16</ProcessorCount><ProcessorCores>8</ProcessorCores><PhysicalMemoryMB>32701</PhysicalMemoryMB><ComputerName>BUILDPC</ComputerName><ComputerModel>System Product Name (System manufacturer)</ComputerModel><UnityVersion>2018.3.0f2</UnityVersion><SupportedLicenseVersion>6.x</SupportedLicenseVersion></SystemInfo><License id="Terms"><MachineID Value="mweMG/ce0YSgfukLssEA8Ib+XdM=" /><MachineBindings><Binding Key="1" Value="00330-50320-95121-AAOEM" /><Binding Key="2" Value="00523_58_217053_1A.F" /><Binding Key="4" Value="U3lzdGVtIFNlcmlhbCBOdW1iZXI=" /><Binding Key="5" Value="60:45:cb:9d:a1:2e" /></MachineBindings><UnityVersion Value="2018.3.0f2" /></License></root>
    LICENSE SYSTEM [2019111 15:14:16] Received https://activation.unity3d.com/license.fcgi?CMD=9&TX=1805c48f8756bb04d8054a536ba2a6d6&RX=GEN-cf158301-3b15-4544-873f-5153ab187449
    LICENSE SYSTEM [2019111 15:14:16] Headers:
    HTTP/1.1 200 OK
    sc-request-id: 9e009cf6-bb2e-49aa-b2d5-f2549ae29bc4
    Vary: Accept-Encoding
    sc-token-expires-in: 126
    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0
    Content-Type: text/xml
    Date: Fri, 11 Jan 2019 14:14:14 GMT
    Content-Length: 2704

    LookupAccountName() failed. Error 1332
    LICENSE SYSTEM [2019111 15:14:16] Couldn't set permissions of the license file (Win32_AddFileAccessRights).
    LICENSE SYSTEM [2019111 15:14:16] License activated successfully with user: *****@****.com
    LICENSE SYSTEM [2019111 15:14:16] Next license update check is after 2019-01-12T14:14:15
    LookupAccountName() failed. Error 1332
    LICENSE SYSTEM [2019111 15:14:16] Couldn't set permissions of the license file (Win32_AddFileAccessRights).
    Built from '2018.3/release' branch; Version is '2018.3.0f2 (6e9a27477296) revision 7248423'; Using compiler version '191326128'
    OS: 'Windows 10 (10.0.0) 64bit' Language: 'en' Physical Memory: 32701 MB
    BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1
    [Package Manager] Server::Start -- Port 59924 was selected
    COMMAND LINE ARGUMENTS:
    C:\Program Files\Unity\Editor\Unity.exe
    -quit
    -serial
    (hidden)
    -batchmode
    -username
    *****@****.com
    -password
    (hidden)
    C:/T6Build/StreetOutlaws
    Using Asset Import Pipeline V1.
    Initiating legacy licensing moduleLoading GUID <-> Path mappings...0.000143 seconds
    Loading Asset Database...0.067640 seconds
    Build target: OSXUniversal found and added!
    Build target: WindowsStoreApps found and added!
    Build target: Win64 found and added!
    Build target: Win found and added!
    Build target: LinuxUniversal found and added!
    Build target: Linux64 found and added!
    Build target: Linux found and added!
    Build target: iOS found and added!
    Build target: tvOS found and added!
    Build target: PS4 found and added!
    Build target: XboxOne found and added!
    Build target: Android found and added!
    Build target: WebGL found and added!
    Build target: Switch found and added!
    Build target: Lumin found and added!
    Build target: PSM found and added!
    Build target: PSP2 found and added!
    Build target: WiiU found and added!
    Build target: Web found and added!
    Build target: WebStreamed found and added!
    Build target: OSXIntel found and added!
    Build target: OSXIntel64 found and added!
    Build target: BlackBerry found and added!
    Build target: PS3 found and added!
    Build target: N3DS found and added!
    Build target: WP8 found and added!
    Build target: SamsungTV found and added!
    Build target: Tizen found and added!
    AssetDatabase consistency checks...0.086655 seconds
    Refreshing native plugins compatible for Editor in 49.30 ms, found 2 plugins.
    Preloading 0 native plugins for Editor in 0.00 ms.
    DisplayProgressbar: Unity Package Manager
    [Package Manager] Done resolving packages in 0.39s seconds
    [Package Manager] Registering 38 packages:
    [...] (Package manager stuff)
    [Package Manager] Server::Kill -- Server was shutdown
    Cleanup mono
    Exiting batchmode successfully now!
    Exiting without the bug reporter. Application will terminate with return code 0

    It seems Unity reactivates the license I just returned on start up before even getting to the command line arguments.
    So in the end, I end up with the same license I started with.

    Of course I'm seeing the permission error, however the folder with the license file got full permissions and the license file is successfully removed in the first step, even with this error.

    I would appreciate any help or a different approach if someone was able to create a automated build system with license switching.

    Kind Regards,

    Tamino Heiartz
     
  2. TaminoTeam6

    TaminoTeam6

    Joined:
    Nov 14, 2018
    Posts:
    4
    Quick update.

    I managed to solve the problem by reinstalling Unity and add-on.
    Apparently the license switch worked just fine, only since the add-on wasn't properly working, I couldn't switch the platform.
    That's why I was under the impression, that switching the license had failed.