How to generate new stub executables

22/05/2019 Cliff Hobbs   ID: 286940

Overview

The Auto Packager automatically generates stub executables for use in Cloudhouse Compatibility Containers™, specifically for use with Appxs created by Microsoft's Desktop App Converter.

The benefits for apps running in the Appx that are provided by stub executables are that they enable the:

  • Appx to handle multiple file type associations for the application in the AppManifest.xml file.
  • Container to handle arguments for the programs that need to be started by the Appx.
  • Container to handle file arguments. Filenames passed to any of the stub executables will be passed onto the application so that it can open the file.

The Auto Packager creates stub executables for each run condition it generates in the Programs.xml during the packaging process. Each stub executable is given the name of the run condition it controls.

For example, run1.exe will execute the command specified in the tag <RunCondition>run1</RunCondition>.

The Auto Packager includes the Cloudhouse.Container.StubGenerator.exe utility which is used to generate stub executables from new or modified run conditions.

Usage:

StubGenerator.exe Target_Executable Host_Executable Host_Executable_Arguments [Host_Dynamic_Arguments] 

where:

Target_Executable
The stub executable that the StubGenerator will generate.
Host_Executable

The executable the generator will invoke when the Target_Executable is invoked. For example, Cloudhouse.Container.Run.exe

Host_Executable_Arguments

The arguments or flags, that are passed to the Host_Executable when the Target_Executable is invoked. If there is more than one argument you will need to surround these with double quotes. For example:

StubGenerator.exe "myrun.exe Cloudhouse.Container.Run.exe" log

Host_Dynamic_Arguments

Contains an expression that enables arguments to be passed to the stub and propagated to the Host_Executable. For example:

StubGenerator.exe myrun.exe Cloudhouse.Container.Run.exe /log "--FileArgs {0}"

This will create myrun.exe which will invoke Cloudhouse.Container.Run.exe with logging enabled, and then open the file readme.txt

If nothing is specified here, the default value for Host_Dynamic_Arguments is "--FileArgs {0}", and the arguments passed to the Target_Executable are propagated to the Host_Executable.


Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support