Author: fbysss
Blog: blog.csdn.net/fbysss
Disclaimer: This article is original from fbysss. for reprinting or reference, please specify the reference address.
We can see that many software may have some options after installation, such as "view readme" and "run program". How does this happen?
Keywords: onmoved, sdfinish
1. The installshieldx script has an onmoved event. This event is triggered after the copy of the file to be installed is complete;
2. sdfinish is a standard dialog box function. Its prototype is sdfinish (sztitle, szmsg1, szmsg2, szopt1, szopt2, bvopt1, and bvopt2). It can be found from the parameters that only up to two options are provided here.
The instance code is as follows:
Function onmoved ()
String sztitle;
String szmsg1, szmsg2, szopt1, szopt2;
Bool bvopt1, bvopt2;
String szapplicationpath, szapplicationline line, szcmdline;
Begin
If (maintenance) then return 0; endif; // if it is not the installation status, for example, when modifying/uninstalling the status, it is not executed.
Sztitle = "Installation Complete"; // the title of the dialog box
Szmsg1 = "% P installation completed./N" +
"Select the following options as needed."; // % P indicates the software product name.
// If you want to set the product name here separately, use the following two statements:
// Szproductname = "XX software ";
// Sdproductname (szproductname );
Szmsg2 = "Click 'complete' to complete % P installation .";
Szopt1 = "read the README file"; // if this field is empty, only one option is available.
Szopt2 = "running program ";
Sdfinish (sztitle, szmsg1, szmsg2, szopt1, szopt2, bvopt1, bvopt2 );
If (bvopt1) then
Launchapp ('notepad.exe ', targetdir ^ "// readme.txt"); // launchapp is used to run an external program
Endif;
If (bvopt2) then
Launchapp (targetdir ^ "// app.exe ","");
Endif;
End;