Make Windows Executables: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
No edit summary
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
Make Windows Executable makes an exe installer file from your app. It can be redistributed to other users with Window system.
'''''This page was deprecated in AppStudio 7.3. Please see [[Using Node and Electron to build Desktop Apps]]'''''
 
Make Windows Executable makes an exe installer file from your app. It can be redistributed to other users with Windows systems.


To run it, use Make Windows Executable (exe) App on the Run menu. A few seconds later. the exe will be produced. Depending on your settings in Preferences, it will be in one of two places:
To run it, use Make Windows Executable (exe) App on the Run menu. A few seconds later. the exe will be produced. Depending on your settings in Preferences, it will be in one of two places:
Line 5: Line 7:
# If Preferences are set to 'Deploy to local folder', the exe file will be in that local folder.
# If Preferences are set to 'Deploy to local folder', the exe file will be in that local folder.
# Otherwise, the exe file be in a folder named with the project's ID in the project folder.
# Otherwise, the exe file be in a folder named with the project's ID in the project folder.
=== Properties ===
The settings for exe files are in the [[Properties Window]], under EXE Settings.
You can also set the [[WindowStyle]] in Project Properties. A typical setting would be
<pre>
wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN
</pre>


=== Notes ===
=== Notes ===


* All the files in the project folder get included in the exe file. It's best to keep your app in its own folder, and to keep it tidy.
# All the files in the project folder get included in the exe file. It's best to keep your app in its own folder, and to keep it tidy.
# The default size of the window at runtime is the project's defaultformsize property.
# The version, copyright and title are all taken from your project's properties.
# It works by packaging your app with a Windows runtime wrapper. InnoSetup (built into AppStudio) is then used to make a full Windows installer. Running it will install your app into Program Files and add it to the Windows Start menu.
# At runtime, it uses the Internet Explorer 11 engine. Users will need to have this installed to run apps.
# The [[EXE.pythonEval]] function can be used to execute code in the wrapper, such as system calls.


* The default size of the window at runtime is the project's defaultformsize property.
=== Example ===


* The version, copyright and title are all taken from your project's properties.
# Create a small project called myApp in a new folder called myProject.
# Check that "Deploy to local folder" is not set in Preferences.
# From the Run menu, choose "Make Windows Executable (exe)".
# A new folder called myApp should now be in the myProject folder.
# In that, you will find myApp.exe, along with other files which will be useful if you want to make a more advanced installer of your own.
# Click on myApp.exe to run the install for the app.
# When it finishes, it will ask whether you want to start the app.
# You can also start it from the Windows Start menu.


It works by packaging your app with a Windows runtime wrapper. InnoSetup (built into AppStudio) is then used to make a full Windows installer. Running it will install your app into Program Files and add it to the Windows Start menu.
=== Testing ===


At runtime, it uses the Internet Explorer 11 engine. Users will need to have this installed to run apps.
EXE apps can be tested without having to create a new installer and run it each time. Here's how:


=== Example ===
# Using Preferences, set the Deploy location to a local folder.
# Make sure Python 2.7.13 or later is installed.
# Copy the following files into that folder: Wrapper.py, LocalServer.py, package.json and LauncherIcon57.ico.
# Test your app by running Wrapper.py.


# Create a small project called myApp in a new folder called myProject.
How it works: Wrapper.py is a simple app which loads your index.html (and the files it uses) into a web browser. That same Wrapper.py is the core of the EXE file which gets created, so the runtime environment is the same.


# Check that "Deploy to local folder" is not set in Preferences.
=== Distributing other files with your App ===


# From the run menu, choose Make Windows Executable (exe) app.
You can include additional files and folder in your app, to be installed in the same directory in Program Files.


# A new folder called myApp.nsx should now be in the myProject folder.
# Do the same steps as in the Example above with your app.
# Add the additional files and folders to the new directory created in step 4.
# Run "Make Windows Executable (exe)" again.
# The files will now be included in the installer.


# In that, you will find myApp.exe, along with other files which will be useful if you want to make a more advanced installed of your own.
=== Restrictions ===
# SQLite is not supported. This is due to IE not supporting SQLite.
# Geolocation is not supported.
# This has been tested on Windows 10, but not on Windows 7.

Latest revision as of 18:26, 21 February 2019

This page was deprecated in AppStudio 7.3. Please see Using Node and Electron to build Desktop Apps

Make Windows Executable makes an exe installer file from your app. It can be redistributed to other users with Windows systems.

To run it, use Make Windows Executable (exe) App on the Run menu. A few seconds later. the exe will be produced. Depending on your settings in Preferences, it will be in one of two places:

  1. If Preferences are set to 'Deploy to local folder', the exe file will be in that local folder.
  2. Otherwise, the exe file be in a folder named with the project's ID in the project folder.

Properties

The settings for exe files are in the Properties Window, under EXE Settings.

You can also set the WindowStyle in Project Properties. A typical setting would be

wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN

Notes

  1. All the files in the project folder get included in the exe file. It's best to keep your app in its own folder, and to keep it tidy.
  2. The default size of the window at runtime is the project's defaultformsize property.
  3. The version, copyright and title are all taken from your project's properties.
  4. It works by packaging your app with a Windows runtime wrapper. InnoSetup (built into AppStudio) is then used to make a full Windows installer. Running it will install your app into Program Files and add it to the Windows Start menu.
  5. At runtime, it uses the Internet Explorer 11 engine. Users will need to have this installed to run apps.
  6. The EXE.pythonEval function can be used to execute code in the wrapper, such as system calls.

Example

  1. Create a small project called myApp in a new folder called myProject.
  2. Check that "Deploy to local folder" is not set in Preferences.
  3. From the Run menu, choose "Make Windows Executable (exe)".
  4. A new folder called myApp should now be in the myProject folder.
  5. In that, you will find myApp.exe, along with other files which will be useful if you want to make a more advanced installer of your own.
  6. Click on myApp.exe to run the install for the app.
  7. When it finishes, it will ask whether you want to start the app.
  8. You can also start it from the Windows Start menu.

Testing

EXE apps can be tested without having to create a new installer and run it each time. Here's how:

  1. Using Preferences, set the Deploy location to a local folder.
  2. Make sure Python 2.7.13 or later is installed.
  3. Copy the following files into that folder: Wrapper.py, LocalServer.py, package.json and LauncherIcon57.ico.
  4. Test your app by running Wrapper.py.

How it works: Wrapper.py is a simple app which loads your index.html (and the files it uses) into a web browser. That same Wrapper.py is the core of the EXE file which gets created, so the runtime environment is the same.

Distributing other files with your App

You can include additional files and folder in your app, to be installed in the same directory in Program Files.

  1. Do the same steps as in the Example above with your app.
  2. Add the additional files and folders to the new directory created in step 4.
  3. Run "Make Windows Executable (exe)" again.
  4. The files will now be included in the installer.

Restrictions

  1. SQLite is not supported. This is due to IE not supporting SQLite.
  2. Geolocation is not supported.
  3. This has been tested on Windows 10, but not on Windows 7.