4.0 KiB
| Squirrel.Windows / 2. Advanced Usage |
|---|
2.4 More Installing
This section goes into greater detail for items related to section 1.4 Installing.
More on Setup.exe
Setup.exe is a C++ bootstrapper application used to install MyApp on the user's local system.
The Setup.exe file includes the Update.exe application and the latest version of the MyApp package to be installed. A single executable file can be provided due to the WriteZipToSetup.exe tool injecting the appropriate files into the exe.
In addition, the Setup.exe will also ensure that .NET 4.5 is installed on the user's computer.
Installation Location
The Setup.exe, and later the UpdateManager in MyApp must have the ability to write files to and execute files from the application install location. To ensure permission for all types of users, the user's application data directory is selected as the install location (i.e., %LocalAppData%\MyApp).
The installation root really only needs to consist of two types of folders:
- Packages - folder used to download and assemble the update package files.
- App Folders - the "installed" application files for a given version of MyApp.
\%LocalAppData%
\packages
MyApp-1.0.0.nupkg
MyApp-1.0.1-delta.nupkg
MyApp-1.0.1.nupkg
\app-1.0.0
MyApp.exe
\app-1.0.1
MyApp.exe
The packages directory is effectively immutable, it simply consists of the packages we've downloaded. Using the user's local application data directory means that we the needed write-access to the install directory on a per-user basis.
Tip: See Machine-wide Installs for more information on ensuring your application pushed to all users in an enterprise environment.
Detail Install Process
The Setup.exe application preforms the following:
- Ensures .NET Framework Installed - determines if .NET Framework is available, and if not relaunches itself with
/installfx45to download and launch the .NET Framework installer. - Create
%LocalAppData%\MyAppDirectory - creates a directory for the MyApp to be installed. - Extracts
Update.exe- extracts theUpdate.exeapplication to the application directory (%LocalAppData%\MyApp). - Extracts
MyApp.1.0.0-full.nupkg- extracts the MyApp full application package to the%LocalAppData%\MyApp\packages\tempdirectory. - Executes
Update.exeto Finish Install - executes theUpdater.exeapplication with the/installswitch to finish the application installation and then launch the application.- Copy MyApp to
app-1.0.0Directory - copy the full version of MyApp files to a application sub-directory (e.g.,MyApp\app-1.0.0). - Launch MyApp - at the end of the setup process, the Updater launches the newly installed version of MyApp.
- Copy MyApp to
- MyApp Creates Shortcuts - the first execution of the application will cause shortcuts to be created on the desktop and Windows start menu for MyApp.
Desktop & Windows Start Shortcuts
By default, application shortcuts are created on the desktop and the Windows Start menu that point to the Update.exe application with additional arguments pointing to the correct application to execute.
MyApp.lnk (Application Shortcut)
- Target:
C:\Users\kbailey\AppData\Local\MyApp\Update.exe --processStart MyApp.exe - Start in:
C:\Users\kbailey\AppData\Local\MyApp\app-1.0.0
Advanced Install Topics
- Machine-wide Installs - machine-wide Installer via MSI installer.
- Loading GIF - specify a "loading" image during initial install of large applications.
See Also
- 2.1 Integrating: Debugging - tips on debugging your Squirrel application.
- 2.2 More Packaging: Packaging Metadata - description of the various NuGet metadata and MyApp.exe properties used for naming MyApp.
| Next: 2.5 More Updating |
|---|