ExeWrapper



ExeWrapper

Tim Parnell is the owner, developer, and copyright holder of this product, which is licensed — not sold — to you on a non-exclusive basis. By using ExeWrapper you are agreeing to all the terms of this license.
ExeWrapper can be used free-of-charge to sign files without the need to purchase a license. However, to unlock some features of ExeWrapper the purchase of a license key is be required. To sign batches of more than five files, a license key is required.
You are entitled to install your license key on any machine you personally use, however you must be the only user of the license key. Installing a license key on a shared machine is prohibited.
You agree not to share your license key with anyone.
You agree to only use the license key provided directly to you by Tim Parnell or licensed partners and affiliates.
License keys are bound to your email address and are not transferrable without written permission from Tim Parnell. Attempting to transfer your license without permission is a violation of this agreement.
You agree not to decompile, reverse engineer, or modify any part of ExeWrapper.
Tim Parnell reserves the right to cancel the license key of any user who is found in violation of this agreement.
If your local government requires payment of sales, use, VAT or any other kind of tax as a result of the purchase of your ExeWrapper license key, unless it is collected at the time of the purchase, you are responsible for paying that tax.
THE WARRANTIES IN THIS AGREEMENT REPLACE ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE IS PROVIDED 'AS IS' AND TIM PARNELL DISCLAIMS AND EXCLUDES ALL OTHER WARRANTIES. IN NO EVENT WILL TIM PARNELL BE LIABLE FOR ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS.

ExeWrapperWrapper
  • Launching Your Application (Windows)
Launching Your Application (Windows) ExeWrapper

Locate Exe Files Windows 10

  • Exec-wrappers is useful whenever you need a single executable file, but have to do some setup before executing it. If you develop using some kind of environment isolation like conda, schroot, virtualenv you probably wanted to configure a GUI application like an IDE to use the executables available inside these environments.
  • Create native, branded, codesigned Windows, Mac and Linux apps on any machine with just a few lines in your build script.

ExeWrapper Created to improve the process of code signing executables for Windows. This tool allows developers to use their Mac to codesign Windows software. VersionTracker A free tool to help developers maintain and generate version history logs.

Gfxdownloadwrapper

On Windows, it is possible to run a Java application either as a desktop application, or as a Windows Service in the background. In the case of a Service, the Wrapper needs to be able to be installed, removed, started, stopped, have its status queried, etc. Depending on whether the application has a GUI or is meant to be run in a command window also determines how it will be run.

Below are the different methods to start the Wrapper:
  • Dedicated Batch Files:

    Allow the user to double-click on them to take individual actions like installing as a service, starting, etc.

  • Command-Based Batch File:

    Launched from a console and takes a command as a parameter. This is very similar to the script provided on UNIX platforms and is useful for users who prefer to use the command line.

  • Standalone Binary:

    It is also possible to run the Wrapper binary directly from a command line using parameters.

ExeWrapper

On Windows systems, the most common way to launch the Wrapper is to make use of dedicated batch files which perform each action to control the Wrapper. This makes it possible for the end user to double click on the batch file icons or set up links in menus.

When you look in the Wrapper distribution's %WRAPPER_HOME%srcbin folder, you will see a number of template batch files which are each used for a specific task. (There are other files in the directory which are described elsewhere in this page.)

  • App.bat.in:

    Used to run the application as a regular console-based application in the current user's desktop. This can also be useful to test a configuration before running as a Windows Service.

  • SetupApp.bat.in:

    This batch file has been added in Wrapper version 3.5.28 to install components which require administrator privileges on recent versions of Windows.

    Actions performed:
    - from v. 3.5.28: register the application to the Windows Event Log system.
    - from v. 3.5.42: enable or disable the Event Log monitoring occurring whenever the Wrapper process or Java process exit.

  • TeardownApp.bat.in:

    This batch file has been added in Wrapper version 3.5.28 to perform cleanup tasks and reverse changes done with SetupApp.bat.

    Actions performed:
    - from v. 3.5.28: unregister the application from the Windows Event Log system.
    - from v. 3.5.42: disable the Event Log monitoring occurring whenever the Wrapper process or Java process exit.

  • StartApp-NT.bat.in:

    Used to start an installed Windows Service.

  • PauseApp-NT.bat.in:

    Used to pause a running Windows Service. See the wrapper.pausable property page for more information.

  • ResumeApp-NT.bat.in:

    Used to resume a previously paused Windows Service. See the wrapper.pausable property page for more information.

  • StopApp-NT.bat.in:

    Used to stop a running Windows Service.

    This will only stop a service. If the application is running in a console, then you will get an error that the service was not running. Please see the page on how to stop a console application.

  • InstallApp-NT.bat.in:

    Used to install the application as a Windows Service.

  • UninstallApp-NT.bat.in :

    Used to uninstall (remove) the application as a Windows Service. If the service is currently started, it will be stopped.

  • QueryApp-NT.bat.in:

    Used to query the status of a Windows Service. This will tell you whether the service is installed or not, whether it is running, stopped, paused, etc.

When setting up the Wrapper, you can choose which of the above batch files are needed for the application. For example, if an application does not support being paused, then the PauseApp-NT.bat.in and ResumeApp-NT.bat.in files are not required.

Depending on how your file explorer is configured on your computer, you may not be able to see file extensions.

For each required file, simply copy it over to the bin folder of your application. When you do so, rename the file by replacing App with the name of your application, and remove the .in from the end.

Example of Replacing file names:

The beginning of all of the files contain a section with variables that can be customized.

  • _WRAPPER_BASE :

    Controls where the Wrapper binary is relative to the location of the batch file. In most cases, it is recommended to place it in the same location. If you choose to move it to another location, please be aware that by default all relative paths in the Wrapper configuration file will be relative to the location of the Wrapper binary, and not of the batch file.

    It is also possible to rename the Wrapper binary to something else like myapp.exe so that it shows up in the task manager rather than wrapper.exe.

  • _WRAPPER_CONF_DEFAULT :

    Controls the location and name of the default Wrapper configuration file. This relative path is always relative to the location of the Wrapper binary, not the location of the batch file.

  • _WRAPPER_CONF_OVERRIDE :

    Lets the user override the Wrapper configuration file by specifying it as the first parameter. The default value is TRUE.

    Up through Wrapper ver. 3.5.14, the first parameter was always an alternate configuration file.
  • _PASS_THROUGH (Since ver. 3.5.5) :

    Controls whether or not parameters passed to the batch file will be passed as is on to the Java application. For more information, please visit the 'How can I pass command line parameters to my Java Application?' page. This variable only exists in App.bat.in and InstallApp-NT.bat.in.

    The first parameter to the batch file will always be the name of an alternate configuration file. If _PASS_THROUGH is set, then any additional parameters will be passed through to the JVM.

Run in a Console

Running the application in a console (Command Window) can be done by double clicking on the MyApp.bat batch file from within the file explorer. You can also do it by opening a Command Window and running the batch file from the prompt. Because of the way the Wrapper script sets its current directory, it is not necessary to run this batch file from within the bin directory.

Output Example:

Stop the application

The application can be terminated by pressing CTRL-C in the console (command window). This will cause the Wrapper to shut down the application cleanly. For more options, please visit the page on how to stop a console application.

Before proceeding, please make sure you have configured all of the Windows Service related properties in the wrapper.conf file. You should also have verified that the application runs correctly in console mode.

Install as a Windows Service

The application can be installed as a service by double clicking on the InstallMyApp-NT.bat batch file from within the file explorer. It can also be done by opening a Command Window and then running the installed script from the command prompt. If the service is installed successfully, the script will terminate immediately.

If there are any problems, then an error message describing the problem will be displayed. The script will then wait for the user to press a key before terminating.

Command and Output Example:

Start and Stop the Windows Service

The Service can now be started and stopped using the respective batch files.

Command and Output Example:

As the service is a normal Windows Service, you can also start and stop it from the Services Control Panel ([Control Panel] - [System and Security] - [Administrative Tools] - [Service]) on Windows by selecting the service, and then clicking the 'Start Service' button.

Additionally, the service can be controlled using the net start MyApp and net stop MyApp commands.

Command and Output Example:

The net start x and net stop x commands have problems with services that take a long time to start or stop. In most cases they will work, but if a service takes more than a few seconds to stop, the net stop x command will return that the service was stopped even though it is still in the process of stopping. This can lead to problems when a script must wait until a service has actually stopped before proceeding. By using the Wrapper to start and stop the service, you will be guaranteed not to have such problems.

The Wrapper method of starting and stopping the service is also useful in scripts. This is as it does not require the actual name that the service is installed as to exist anywhere except in the wrapper.conf file. This removes the need for manual editing of multiple files if the service name is changed.

If the wrapper.ntservice.starttype property is set to AUTO_START then the service will be started whenever the machine is rebooted.

Uninstall (remove) from the Windows Service

The service can be uninstalled by running the UninstallMyApp-NT.bat batch file. If it is currently running, then it will be stopped first.

Command and Output Example:

Some applications which have been ported over from UNIX-based operating systems may work better with a UNIX-style command script to control the service. The Command-Based batch file combines all of the functionality of the individual dedicated batch files into a single file, which takes a command as a parameter.

When you look in the Wrapper distribution's %WRAPPER_HOME%srcbin folder, you will see a template command batch file, AppCommand.bat.in.

Simply copy this file over to the bin folder of your application. When you do so, rename the file by replacing App with the name of your application, and remove the .in from the end.

Example of Replacing file names:

The beginning of all of the files contain a section which can be customized to fit the file naming and directory structure of your application.

Script configuration block:
  • _WRAPPER_BASE :

    Controls where the Wrapper binary is relative to the location of the batch file. In most cases it is recommended to place it in the same location. If you choose to move it to another location, please be aware that by default all relative paths in the Wrapper configuration file will be relative to the location of the Wrapper binary, and not of the batch file.

    It is also possible to rename the Wrapper binary to something else like myapp.exe so that shows up in the task manager rather than wrapper.exe.

  • _WRAPPER_CONF :

    Controls the location and name of the Wrapper configuration file. This relative path is always relative to the location of the Wrapper binary, not the location of the batch file.

  • _FIXED_COMMAND (Since ver. 3.5.5) :

    Tells the script to use a hard coded command rather than expecting the first parameter of the command line to be a command. By default, the script expects the first parameter to be a command. This is often used when creating multiple files that work similar to the dedicated batch files described above.

  • _PASS_THROUGH (Since ver. 3.5.5) :

    Controls whether or not parameters passed to the batch file will be passed as is on to the Java application. For more information, please visit the 'How can I pass command line parameters to my Java Application?' page. This variable only exists in App.bat.in and InstallApp-NT.bat.in.

The command-based batch file is self-documenting, in that if the user tries running it without any parameters, the script will display its usage.

Usage:
Usage with _PASS_THROUGH enabled:

There are a few differences between this batch file for Windows and the UNIX script. The UNIX script can be used to stop the Wrapper running in a console; however, it is not possible to do so with the batch file for Windows. In addition, the dump command is missing from the batch file for Windows.

As you can see, the command-based batch file provides a wide range of capability:

  • console:

    Used to run the application as a regular console-based application in the current user desktop. This can also be useful to test a configuration before running as a service.

    If _PASS_THROUGH has been enabled, then any additional parameters will be passed directly through to the JVM when it is launched.

  • setup:

    This command has been added in Wrapper version 3.5.28 to install components which require administrator privileges on recent versions of Windows.

    Actions performed:
    - from v. 3.5.28: register the application to the Windows Event Log system.
    - from v. 3.5.42: enable or disable the Event Log monitoring occurring whenever the Wrapper process or Java process exit.

  • teardown:

    This command has been added in Wrapper version 3.5.28 to perform cleanup tasks and reverse changes done with the '--setup' command.

    Actions performed:
    - from v. 3.5.28: unregister the application from the Windows Event Log system.
    - from v. 3.5.42: disable the Event Log monitoring occurring whenever the Wrapper process or Java process exit.

  • start:

    Used to start an installed Windows Service.

  • pause:

    Used to pause a running Windows Service. For more information, please visit the wrapper.pausable property page.

  • resume:

    Used to resume a previously paused Windows Service. For more information, please visit thewrapper.pausable property page.

  • stop:

    Used to stop a running Windows Service.

    This will only stop a service. If the application is running in a console, then you will get an error that the service was not running. Please visit the page How to Stop a Console Application for more information.

  • restart:

    Used to restart an installed Windows Service. This works by first stopping, and then starting the service.

  • install:

    Used to install the application as a Windows Service.

    If _PASS_THROUGH has been enabled, then any additional parameters will be passed directly through to the JVM when it is eventually started or restarted.

  • update:

    Used to update (reinstall) the application as a Windows Service. This is useful when some service-related configuration values have been changed. It differs from removing and then installing the service in that things like account passwords will not need to be re-entered.

    If _PASS_THROUGH has been enabled, then any additional parameters will be passed directly through to the JVM when it is eventually started or restarted.

  • remove:

    Used to uninstall (remove) the application as a Windows Service. If the service is currently started, it will be stopped.

  • status:

    Queries the status of the service.

    Output when service is not installed:
    Output when service is installed but stopped:
    Output when service is running:

As an example, the Wrapper can be started in a console using the following command:

To execute other commands, simply replace 'console' command with the command you wish to have executed.

The Java Service Wrapper can also be run directly without making use of a batch file.

If the wrapper executable is launched without any parameters or with a '-?', the following usage output will be displayed.

Wrapper Usage:

Start the Application

In order to run the Wrapper as a console application, you would specify the -c command, followed by the wrapper.conf file. The location of the wrapper.conf file can be an absolute or relative location. If a relative path is used, the path is always relative to the location of the wrapper.exe file, not the current directory.

Command Example:

Install the Application as a Service

To install the application as a Windows Service, execute:

Command Example:

Start the Application as a Service

Once installed, the service can be started just like any other Windows Service. If the wrapper.ntservice.starttype was set to AUTO_START when installed, then the service will be started the next time the machine is rebooted. It is also possible to start the service from the Services Control Panel ([Control Panel] - [System and Security] - [Administrative Tools] - [Service]) on Windows by selecting the service, and then clicking the 'Start Service' button or with one of the following commands:

Command Example:

The net start x and net stop x commands have problems with services that take a long time to start or stop. In most cases they will work, but if a service takes more than a few seconds to stop, the net stop x command will return that the service was stopped even though it is still in the process of stopping. This can lead to problems when a script must wait until a service has actually stopped before proceeding. By using the Wrapper to start and stop the service, you will be guaranteed not to have such problems.

The Wrapper method of starting and stopping the service is also useful in scripts as it does not require the actual name that the service is installed as to exist anywhere except in the wrapper.conf file. This removes the need for manual editing of multiple files if the service name is changed.

Stopping the Application as a Service

The service can be stopped using the Services Control Panel ([Control Panel] - [System and Security] - [Administrative Tools] - [Service]) on Windows by selecting the service, and then clicking the 'Start Service' button or with one of the following commands:

Command Example:

If you want to uninstall the application as a Windows Service, execute the following command:

Command Example:

If the service is running at the time that it is uninstalled, the service will be cleanly stopped and then removed.

Query the Status of the Application as a Service

The Wrapper can be used to query the state of the service either from the Command Line or from within a batch file. This can be useful for Install Scripts that need to know the current state of the service configuration.

Command and Output Example:

If run with the '-q' command, the Wrapper will display the current status to the console, '-qs' command will run silently. The Wrapper will then exit an exit code that is a combination of the following bits:

  • 1: Service is installed.

  • 2: Service is running.

  • 4: Service is interactive.

  • 8: Start type is automatic.

  • 16: Start type is manual.

  • 32: Start type is disabled.

  • 32768 (2^15): Encountered error when querying the status.

An exit code of '15' (=1+2+4+8), for example, indicates that the service is installed, running, interactive and configured to start automatically when the system is booted. An exit code of '0' (zero) means that the service is not currently installed.

Exe Wrapper

[Windows]
  • Launching Your Application (Windows)
[Linux / Unix] [Common]




Comments are closed.