How to generate new stub executables

23/01/2019 Cliff Hobbs

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

The stub executable provides the following benefits for apps running in the Appx

  • Enables the Appx to handle multiple file type associations for the application in the AppManifest.xml file.
  • Enables the Container to handle arguments for the programs that need to be started by the Appx.
  • Enables the 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.

StubGenerator.exe Target_Executable Host_Executable Host_Executable_Arguments [Host_Dynamic_Arguments]

Target_Executable         - This is the stub executable that the StubGenerator will generator.

Host_Executable           - This is the executable that the generator will invoke when the Target_Executable is invoked, for example Cloudhouse.Container.Run.exe.

Host_Executable_Arguments - These are 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
                                StubGenerator.exe myrun.exe Cloudhouse.Container.Run.exe log

Host_Dynamic_Arguments    - This contains an expression that enables arguments to be passed to the stub, and propagated to the Host_Executable
                            StubGenerator.exe myrun.exe Cloudhouse.Container.Run.exe /log "--FileArgs {0}" 
                            Will create myrun.exe, which will invoke Cloudhouse.Container.Run.exe with with logging enabled, and 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.

Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support