EN RU
Log in
Home
Download
Purchase
Documentation
Support
Contact us
 
Help  /  Examples & tips

How to track the exit from the installation

There may be times when you need to track the exit from the installation process. By default, the installation removes all temporary files in the case of the successful finish, and in case of the interruption of the installation by the user, but you may want to remove something else. Also, you may want to keep track of what stage is interrupted during the installation process and send data to your web server. CreateInstall allows you to perform additional steps when the installation is complete or interrupted.

Let's create an example project that does nothing but tracks all exits from the installation. You can download it at the link below and check out how it works. We describe the function that will be called at any completion of the installation. For this, we use the Source Code command with the checked External Source Code. Let's insert two messages into it, one message will display the completion code and the dialog, in which the user has completed the installation, and the second one will show in the case of successful completion and ask if the user want to open the website.

func myexitcmdproc (uint code)
{
    macrox_setint ("exitcode", code)
    $body$
}

It should be noted that our function gets the code parameter, which is equal to 0 if the setup has been finished successfully. If the user breaks a dialog, the parameter is equal to 2. If the installation is interrupted with the Exit/Reboot command, the codeis equal to the value that you specified in that command. The function name must end with cmdproc. You must define the variable exitfunc and assign it the name of your function that this function is called when the user exits the installation.

Project - Tracking the exit
Project - Tracking the exit

In order to determine in which the dialog the installation was interrupted define the same variable with different values in each dialog command. In this example, we assign different values to the dlg variable, and then display it in the message on exit.

Download the example project tracking-exit.ci
Eonza automation software - free, open source cross-platform program for easy creation and management of scripts.
  • Help
    • Introduction
    • Get to know CreateInstall
    • Compare installers
    • License Agreement
    • License Light
    • License Free
    • Program features
    • Command Reference
    • FAQ
    • Examples & tips
      • Customizing setup.exe
      • Example of use of the dialog function
      • Global and local variables
      • How to manage the reboot
      • How to use conditional statements
      • How to use the command Dialog - Settings
      • How to wait for an event
      • Relative paths in the projects
      • Tracking exit
      • Functions for variables
      • One project for many applications
      • Open shortcut folder
    • CreateInstall Assistant
    • Problem solving
    • Setup Extractor
Copyright © Novostrim, OOO, 2009-2026 All rights reserved.