Search Unity

Bug Batchmode hangs forever when calling external process in PostProcessBuild

Discussion in 'Scripting' started by Telestrator, May 29, 2023.

  1. Telestrator

    Telestrator

    Joined:
    Aug 21, 2018
    Posts:
    10
    This worked without issue for years, seems to be broken now from 2022.2.19f1 and onwards. Anyone encounter issues from this or find workarounds?

    Here's an example with verpatch; call never returns: (works fine in 2022.2.18f1-)

    Code (CSharp):
    1.  
    2. // called via [UnityEditor.Callbacks.PostProcessBuild]
    3. string bundleVersion = PlayerSettings.bundleVersion;
    4.  
    5. string commandLine = string.Format("\"{0}\" \"{1}\" /high /s CompanyName \"Foobar\" /s ProductName {2} /s ProductVersion \"{1}\"", buildLocation, bundleVersion, product);
    6.  
    7. Debug.Log($"Verpatch: {commandLine}");
    8.  
    9. var result = System.Diagnostics.Process.Start(verPatchPath, commandLine);                    
    10.