GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Seventeen — Application Integration Functions (continued)
When the application shuts down, a script can be run to wind down certain user operations. This script is only run after a normal GUI exit.
The post process checks for the file “ApplicationShutdown.ls” in the application “Scripts” folder. If it is not present the application closes. The script file is not supplied as part of the application standard install.
At the point of script entry, all background processes have been terminated, all script hooks shutdown, all windows will have been closed and with the exception of certain internal static classes, all modules shutdown. What this means is certain operations may not be possible upon entry tot he script. For example, opening a file in an edit window or running a menu command is not possible.
17.3.2 Creating a Shutdown Script
The shutdown script can be a simple implied entry script or employ a ‘main’ entry function. If the script encounters a preprocess or runtime error, a message box will be displayed by the application indicating an error. Check the application log for error details.
Shutdown scripts are useful at unwinding operations that are currently in progress, or integrating into other systems to enable better control over who is using the application and where. Functions like ODBC connectivity, File I/O, and HTTP Get/Post requests are still available, so Legato still has the ability to communicate with external applications. Below is an example shutdown script, written for GoFiler Complete:
int main() { string temp_folder; string gofiler; string bat_contents; string bat_file; gofiler = "\""+AddPaths(GetApplicationExecuteFolder(), "GoFiler.exe\""); bat_contents = "timeout /t 3 /nobreak > nul\r\n"; bat_contents += gofiler+ " /NoGUI /unregister -silent\r\n"; temp_folder = GetTempFileFolder(); bat_file = AddPaths(temp_folder, "RegisterGF.bat"); StringToFile(bat_contents,bat_file); RunProgram("cmd.exe", "/C \""+bat_file+"\""); return ERROR_NONE; }
This script writes out a batch file to the user’s temporary files directory, then executes the batch file before the application closes. The batch file itself simply waits for 3 seconds, then runs GoFiler Unregister command in No GUI mode, with the silent flag set. This effectively unregisters the application from our server so the key is able to be used on a different machine. This is useful in production environments that require switching the license from one user to the other at the end of a shift.
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.