| InstallerContactSite Map |
Advanced Installer User Guide | |||
Predefined Custom Actions |
| Below is a description of the custom actions used in Advanced Installer.
Launch File or Open URLThis is a predefined attached custom action. It allows the launching of a file into execution or opening of a folder (the same action that occurs when you double-click it in Explorer). You can also supply an URL and that page will be opened in the default browser on the target computer. This action is performed by a program that comes with Advanced Installer, called viewer.exe. Description of fields:
Syntax for the Command Line field: [/dir <working_directory_path>] <file_to_launch> <parameters>
Command Line Examples: http://www.example.com or [#filekey] command line parameters
"[#filekey]" command line parameters There are often cases when you want to specify a working directory for the file you are launching, be it an EXE or a .bat and so on. This can be achieved by using the /dir option as follows: /dir "C:\Program Files" [#MyFile.bat] param1 param2 This will set the current working directory to "C:\Program Files". Call a function from a standard dllThis predefined custom action can be used to call a function from a dll. Unlike native dll custom action where the function you call must have a predefined signature this custom action allows you to call a function with any signature. Use the Edit Function dialog to easily describe the signature of the function you want to call (the result will be shown in the "Action Data" field).
Resolve Known FoldersThis predefined custom action can be used to resolve a property based folder to the path of a known folder in Windows Vista (or later operating systems).
In order to use this predefined custom action in your project, follow the steps below: a) In the Install Parameters page, create a new public property (only upper-case letters in its name), for instance MY_VISTA_FOLDER_PROP. b) Set the value of the property to a known folder GUID. The complete list of known folder constants can be found here. For instance, if the per-user folder FOLDERID_SavedGames ("%USERPROFILE%\Saved Games") is required, you will set the value of the property to the following GUID: {4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}c) In the Files and Folders page create a new property based folder, specifying the property you have defined above. You can now add content to this property based folder. d) The Resolve Known Folders predefined custom action can be added under any standard action before CostFinalize. We shall sequence it after AppSearch, for instance. e) In the Custom Actions page, make sure that the AppSearch standard action is visible in the tree control under both InstallUISequence and InstallExecuteSequence. If it is not, use the “Show Standard Action” toolbar button or context-menu entry to make it visible. f) Add the predefined Resolve Known Folders custom action under "InstallUISequence -> AppSearch". g) Keeping the SHIFT key pressed, drap-and-drop the custom action in tree control, under "InstallExecuteSequence -> AppSearch". This will create a copy of the action in the InstallExecuteSequence. h) For both instances of the custom action set the “Action Data” field to the name of the property you have defined in step 1 above (MY_VISTA_FOLDER_PROP in the example, NOT the formatted value [MY_VISTA_FOLDER_PROP]). You can add many properties separated by ; character. i) Set the Scheduling Option for the custom action to “ Execute only once if present in both sequence tables”. Installed .NET AssemblyThis is a custom action that launches a .NET Assembly. The assembly must have a class that inherits the Installer class with the RunInstaller attribute set to true. Assembly Target PlatformCustom actions are created and conditioned depending on your assembly target platform:
You can also modify the execution conditions as desired. Description of the fields:
Close ApplicationThis custom action allows you to close an application which uses an User Interface. It basically sends WM_CLOSE messages to all windows created by the application process. After adding the custom action, in its Custom Action Properties page the Action Data field should be set to the name of the main EXE of your application. If this field is not shown, you can set the CustomActionData property to the EXE name before the custom action runs.
By default the custom action closes windows which have a titlebar, a border and a system menu. If you want to specify custom style flags you can set the AI_CLOSEAPP_WINDOW_FLAGS property to the flags you want. For example, the property can be set to: WS_SYSMENU | WS_OVERLAPPED | WS_VISIBLE
Detect ProcessThis custom action allows you to detect a running process on the target machine. For more details please see the Detect or stop a process how-to. Terminate ProcessThis custom action allows you to stop a running process on the target machine. For more details please see the Detect or stop a process how-to. Detect ServiceThis custom action allows you to detect a service on the target machine. For more details please see the Detect a service how-to. Check If User ExistsThis custom action allows you to check if a specific user account exists on the target machine or inside the installer. It was designed to work with the "LogonInformationDlg" dialog, but it can also be used separately. The custom action uses the following properties:
Start Image SlideshowThis custom action will start an image slideshow configured in the Image Slideshow page. Please note that the custom action is available only in an Enterprise project when using a custom trigger for the start option. Also, excepting the "Expression" field in the " Execution Condition" section, it is recommended to keep the default settings of the custom action. Stop Image SlideshowThis custom action will stop an image slideshow configured in the Image Slideshow page. Please note that the custom action is available only in an Enterprise project when using a custom trigger for the stop option. Also, excepting the "Expression" field in the " Execution Condition" section, it is recommended to keep the default settings of the custom action. Message BoxThis custom action will display a message box. The Display a message box how-to explains the usage of this custom action. Topics
|
