title: UWP LaunchFullTrustProcessForCurrentAppAsync - EXE file not found
body: <p>We are creating a UWP application which is intended for Side loading only.
  At various times this application needs to reboot the PC (it's desktop only), to do this we intend to use LaunchFullTrustProcessForCurrentAppAsync() to call a simple external EXE which uses Process.Start("shutdown") to reboot the PC.</p>
  
  <p>We have created the EXE called RebootPC.exe and on it's own it works fine.</p>
  
  <p>We now include it in our UWP project:</p>
  
  <p>First we add the desktop and rescap namespaces to our project and we also add rescap to our IgnorableNamspaces</p>
  
  <pre><code>xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" 
       xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" 
       IgnorableNamespaces="uap mp uap5 rescap"&gt;
  </code></pre>
  
  <p>Then, we then modify the Extension section to include our EXE, we know we cannot put the EXE in our project root as C# compiler removes it so we have put it in a sub folder (in this case \Assets). We also set the EXE's type to 'Content' and 'Copy always' in the Solution explorer</p>
  
  <pre><code>&lt;desktop:Extension Category="windows.fullTrustProcess" Executable="Assets\RebootPC.exe"&gt;
        &lt;desktop:FullTrustProcess&gt;
          &lt;desktop:ParameterGroup GroupId="rebooter" Parameters=""/&gt;
        &lt;/desktop:FullTrustProcess&gt;
      &lt;/desktop:Extension&gt;
  </code></pre>
  
  <p>finally in the manifest we add rescap to the Capabilities section - we know it has to be first in the list otherwise you get a manifest error when packaging</p>
  
  <pre><code>&lt;Capabilities&gt;
  &lt;rescap:Capability Name="runFullTrust"/&gt;
  &lt;Capability Name="internetClient" /&gt;
  &lt;DeviceCapability Name="bluetooth" /&gt;
  &lt;DeviceCapability Name="radios" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>OK, so the manifest is changed. We now go to our C# code:</p>
  
  <p>In that we perform the following:</p>
  
  <pre><code>if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
              {
                  try
                  {
                      await Windows.ApplicationModel.FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
  
                  }
                  catch (Exception ex)
                  {
                      Debug.WriteLine(ex.Message);
                  }
  
              }
  </code></pre>
  
  <p>When we build and run the project in Visual Studio it seems to work fine, under the intended circumstances the PC will reboot as intended.</p>
  
  <p>The problem comes when we try to package it for installation on other PCs. We use Store->Create App Packages (remember this application is for side loading only).</p>
  
  <p>The creation of the package works fine and we can install it on other PCs with no problem. The problem is that when we run the Application and it comes time to run the external EXE to reboot the PC a command window opens but we get an exception saying "System can't find c:\users.......\Assets\RebootPC.exe"</p>
  
  <p>So, even though the packaging is done without error and even though we have set the properties of RebootPC.exe to 'Content' and 'Copy always' it is either not being included in the package or not being installed along with the App?</p>
  
  <p>So, does anyone know how we can check if it is being included in the package? and if so how we can check if and where it is being installed on the target machine? or has anyone else had this issue and found the solution?</p>
  
  <p>This has had us baffled for days and is driving us crazy!!!</p>
  
  <p>UPDATE: I think the issue may not be that RebootPC.exe can't be found but rather shutdown.exe - If this is the case then it's a bit of a school boy error!!!
  Anyway, I will sort this and see if that fixes the issue</p>
  
  <p>I will leave the rest of the question up as it might provide useful information for others</p>