IS2009 Making an Oracle Silent installation package (ii) Thank you, Mr. Blank. Licensing

Source: Internet
Author: User

Original: IS2009 making Oracle Silent installation package (ii) Thank you, Mr. Blank. Licensing

Previous: IS2009 making Oracle Silent installation package (a) Thank you Mr. Blank Licensing

This article by the original author authorized in the Sea goddess issued, reproduced please be sure to indicate the source and link; The original author and the Goddess of the Sea reserve the rights to all laws of the article; need to be published in a profitable newspaper, website, etc. please contact the original or the goddess of the sea.

Part III: Using IS2009
Wizard Settings
1. Open InstallShield2009 and create a new InstallScript MSI project, it is recommended to select this project because the
Scripts are supported by the process. Select the type of Windows Installer > InstallScript MSI projcet

2. Go to the IS Wizard Setup interface, and we'll set it up separately. Information page for application

3. Click Navigation, go to Installation Architecture page, select Yes to set the software component structure. Files for Ann
Database file for the file.

4. Click Navigation, go to the Application Files page, set the installation destination folder, and in the database folder
Add the following file below.

Installation Design
1. After a simple operation in the wizard settings, go to the Installation Design tab page.

2. View the installation directory and language settings on the basic Settings page

3. Set the installation path and other settings in Organization–>features. Settings for files

For Database settings, note that the target path is [Installdir]database, the folder is in the Files folder
The directory under.

Please set the oninstalling, oninstalled, onuninstalling, onunistalled options. This option allows you to use
User to specify and invoke the associated install Scripe function. We will talk about how to do this in the script programming
Write code in the function.


4. Users can also view or add modified files in application Data->files and Folders.

5. Add the files required to install the package under Disk1 in behavior and Logic->support files/billboards
and folders. The Win32 folder is the folder where the underlying script resides; The database folder is the installation folder for Oracle;
Temp_10g.dbc and TEMP_10G.DFB are the template files for the build library.

The above steps complete the basic setup and installation settings in is, as long as the directory structure is selected, the Files folder is
The folder for the installer file, whose parameters are [INSTALLDIR]. Its directory is the database folder. Parameters
is [Installdir]database. Also note that the 3 script files must be placed in the specified folder location, the relationship
Calls to each other in the scripting language.
The supporting files will be stored in the following directory with the CD, which makes it convenient for us to call these files directly.

Part IV: Script Programming in IS2009
Passing Source Path parameters
During the use of the is installation process, we are not able to copy all the information to the local hard drive for installation, usually
This will read some information on the source disk, such as the contents of a path under the disc. But how to get the installation path
What about the path information? And how do you get the batch files to learn about them?
Here we use the 3 functions in the IS library:
Batchadd (Add an environment variable to a batch file)
Batchfileload (Load a batch file into memory to edit it with the advanced batch function)
Batchfilesave (Save a batch file loaded by Batchfileload)
The Batchadd function inserts a set command or other DOS command into an already loaded by batchfileload
stored in a batch file. The parameter noptions allows you to add a new command to the first or last statement of a file,
Replaces an existing statement with a new command, or specifies that a new command be added before or after an existing statement. Call
Before Batchadd, you must call Batchfileload to load the files you want to modify into memory. After you have modified the file,
Call Batchfilesave to save it to disk.
Let's use these functions in IS2009.
1. In installation Designer, select InstallScript in Behavior and logic in the is left column.
2. At the top of the script box, drop-down selection box, select files
3. After that, select the drop-down box on the right and select installed
Installed is selected because the Install.bat batch script is copied to the local hard disk during the installation process.
Only after a successful replication can we call the batch script and use these functions.

The specific script in the installed function is as follows:


#define Example_bat installdir^ "Database\\install.bat"
#define Example_bak "Install.bak"
Export prototype defaultfeature_installed ();
function defaultfeature_installed ()
STRING Targ,source,targ1;
STRING Dbpath,data,datasur,title;
Begin
Load the batch file to be edited.
if (Batchfileload (Example_bat) < 0) Then
MessageBox ("Unable to load" + example_bat+ ".", SEVERE);
Abort

endif
DBPATH = srcdisk + "\ \";
Add the line SET PATH = srcdisk+ "\ \".
if (Batchadd ("Sourpath", DBPATH, "", before) < 0) Then
MessageBox ("Second Call to Batchadd failed", WARNING);
Abort
endif
Save the updated file; Back up the original file.
if (Batchfilesave (Example_bak) < 0) Then
MessageBox ("Unable to save" + Example_bak + ".", SEVERE);
Else
MessageBox ("Batch file saved. Backup created. ", information);
endif


In this script, we define the installation path of the Install.bat and call it at the beginning with the Batchfileload function,
Note that the call is not executed but is temporarily called in memory. Then set a variable DBPath = srcdisk
+ "\ \", Srcdisk is the location where Setup.inx is judged, take out the installation letter, of course, we want to add a backslash
behind. For example, the CD is in F: We are doing this to insert set Sourpath = F:\ in the first line of the batch. The
Batchadd function is used to load this variable, which is guaranteed to be set at the very beginning of the batch file. Finally, let
Save the batch file with Batchfilesave.
Again, we also need to do this in Deinstall.bat when uninstalling, except to determine the location of the
uninstalling and define the Deinstall.bat installation path.

The specific script in the uninstalling function is as follows:
#define Uninstall_bat installdir^ "Database\\deinstall.bat"
#define Uninstall_bak "Deinstall.bak"
Export prototype defaultfeature_uninstalling ();
function defaultfeature_uninstalling ()
STRING Targ,source;
STRING Dbpath,data,datasur,title;
Begin
Load the batch file to be edited.
if (Batchfileload (Uninstall_bat) < 0) Then
MessageBox ("Unable to load" + example_bat+ ".", SEVERE);
Abort
endif
DBPATH = srcdisk + "\ \";
Add the line SET PATH = srcdisk+ "\ \".
if (Batchadd ("Sourpath", DBPATH, "", before) < 0) Then
MessageBox ("Second Call to Batchadd failed", WARNING);
Abort
endif
Save the updated file; Back up the original file.
if (Batchfilesave (Uninstall_bak) < 0) Then
MessageBox ("Unable to save" + Uninstall_bak + ".", SEVERE);

Else
MessageBox ("Batch file saved. Backup created. ", information);
endif

Execute batch file
We modified the batch file to execute it after the modification was saved. This requires the
Launchappandwait () function
syntax in the IS function library: launchappandwait (Szprogram, szCmdLine, lwait);
Description: The Launchappandwait function runs an application specified by Szprogram with the command-line
parameter specified by szCmdLine. The third parameter, lwait, indicates whether the installation waits until the application runs until the end of the
before continuing.
One Setup program can monitor only the applications specified by Szprogram, and if the application is to run other programs or processes that should be
, Setup cannot monitor them. Therefore, the installer will continue after the first application finishes,
even if other applications run by the first application are still running. Note If the running application terminates the
failure, the installer waits indefinitely for the running application to complete.
added after the installed script:
Targ = installdir^ "Database";
if (launchappandwait (installdir^ "Database\\install.bat", targ,laaw_option_wait |
Laaw_option_hidden) < 0) then
MessageBox ("Unable to launch Install.bat", SEVERE);
endif
End;
Laaw_option_hidden This parameter is the execution window that hides the bat, which is used with
laaw_option_wait and is hidden and waits for the program to return after the execution is complete, paying attention to their order. The
is added after the uninstalling script:

Targ = installdir^ "Database";
If
(Launchappandwait (installdir^ "Database\\deinstall.bat", targ,laaw_option_wait |
Laaw_option_hidden) < 0) Then
MessageBox ("Unable to launch Deinstall.bat", SEVERE);
endif
End
The script is complete, we compile the script, and determine that there are no problems.

Part V: Other
Modify the interface style
1. In installation Designer, select dialogs in user interface in the is left column
2. Select Skins in the right window, then click Select
3. interface window style changes

Compile Package
1. In installation Designer, select the realrases in media in the is left column
2. In the right column releases right click, select Releaseswizard ...
3. The wizard interface appears
4. In this interface, note several interfaces, the rest are the default
5. Filter setting interface, do not make any choice
6. Media type interface, select Network Image

Note: Do not select the site to filter!! Default, if selected, resulting in the reading disc 1158 problem! As an error diagram

Complete installation package files

Part VI: Problems encountered
1158 Problem: Filter language operation causes, do not select filter items can
Chinese input garbled problem: Chinese input in the wizard can be
Environment variable PROBLEM: Since is provides the ability to set environment variables, it is first assumed that setting environment variables in IS can
Read through bat, but it is wrong to do so, the variable can be added successfully, but not allow the call of that time, so
Discard this method and use a function instead.
Design thinking Problem: Start is to create a new library, and import the table separately, create users, import data, so the trouble to
Dead, the parameters of the problem continued. Later, you use data templates to build the library.
Directory problem: This is the beginning of the plan, the file and database are separated by different directories, the UI appears two paths
Select the page, but is only provide a parameter to install the INSTALLDIR directory, and the other directory path I do not
Know how to get and call. Therefore, the database folder was created under the InstallDir directory.
Part VII: summary
I first use is, took a lot of detours, first started with is Express version, found that there is no use of scripts, change
IS09, due to the unfamiliar of Oracle, the unfamiliar batch process, is programming language unfamiliar, resulting in this production
The process is rather lengthy. The fragmented lasted one months.
Thanks to the help of the IS group, they are the driving force for me to move forward. The problem is eliminated, the product is finished and submitted to Oracle.
Special Thanks, ocean Goddess, Yi Ting, Blue, Yu Xin, CSP, etc...
All of the above includes only Oracle packaging, where the company's product applications are not.
IS group 19622645 blank making qq:28021418

Some source code
Export prototype new_feature_installing ();
function new_feature_installing ()
Begin
End
//---------------------------------------------------------------------------
The installing event is sent before the feature Defaultfeature
Is installed.
//---------------------------------------------------------------------------
Export prototype defaultfeature_installing ();
function defaultfeature_installing ()
STRING DISKPATH,SZCOMMAND,SZCMDLINE,SZCOMMANDECP,SZCMDLINEECP;
Begin
Diskpath = srcdisk + "\ \"; Defining the installation disk path
Run the FRAMEWORK20 Setup program
if (launchappandwait (srcdir^ "Supportfiles\\dotnetfx.exe", "", laaw_option_wait/* |
laaw_option_hidden*/) < 0) Then
MessageBox ("Unable to launch dotnet", SEVERE);
endif
If
(Launchappandwait (srcdir^ "Supportfiles\\framwork2.0\\setup.exe", "", laaw_option_wait/*
|
laaw_option_hidden*/) < 0) Then
MessageBox ("Unable to launch Dotnet2", SEVERE);
endif
Define MSI file parameters and MSI file locations
Szcommand = winsysdir^ "Msiexec.exe";
Longpathtoshortpath (Szcommand);
szCmdLine =srcdir^ "Supportfiles\\enginert\\setup.msi";
Longpathtoshortpath (szCmdLine);
Run the MSI file
if (launchappandwait (Szcommand, "/i" +szcmdline,laaw_option_wait) < 0) Then
MessageBox ("Unable to launch Acgis", SEVERE);
endif
SZCOMMANDECP = srcdir^ "Supportfiles\\softwareauthorization.exe";
Longpathtoshortpath (SZCOMMANDECP);
SZCMDLINEECP =srcdir^ "SUPPORTFILES\\LICENSE.ECP";
Longpathtoshortpath (SZCMDLINEECP);

if (launchappandwait (srcdir^ "Supportfiles\\runecp.bat", diskpath,laaw_option_wait/*
|
laaw_option_hidden*/) < 0) Then
MessageBox ("Unable to launch ECP", SEVERE);
endif
End
//---------------------------------------------------------------------------
The installed event is sent after the feature defaultfeature
Is installed.
//---------------------------------------------------------------------------
#define Example_bat installdir^ "Database\\install.bat"
#define Example_bak "Install.bak"
Export prototype defaultfeature_installed ();
function defaultfeature_installed ()
STRING Targ,source,targ1;
STRING Dbpath,data,datasur,title;
Begin
Load the batch file to be edited.
if (Batchfileload (Example_bat) < 0) Then
MessageBox ("Unable to load" + example_bat+ ".", SEVERE);
Abort
endif
DBPATH = srcdisk + "\ \";
Add the line SET PATH = srcdisk^ "Test".
if (Batchadd ("Sourpath", DBPATH, "", before) < 0) Then
MessageBox ("Second Call to Batchadd failed", WARNING);
Abort
endif
Save the updated file; Back up the original file.

if (Batchfilesave (Example_bak) < 0) Then
MessageBox ("Unable to save" + Example_bak + ".", SEVERE);
Else
MessageBox ("Batch file saved. Backup created. ", information);
endif
Datasur = "c:\\";
DATA = srcdisk^ "Test";
TITLE = "Path buffer example";
Pathset (Datasur);
Sprintfbox (Information,title,
"The starting search path is%s.", Datasur);
if (Pathadd (DATA, "", full, before) < 0) Then
MessageBox ("Unable to add DATA path to path buffer.", SEVERE);
Abort
endif
Pathget (Datasur);
Sprintfbox (Information,title,
"DATA Path added before first path.\n\nthe search Path is%s.",
Datasur);
Targ = installdir^ "Database";
SOURCE = srcdisk^ "Test";
Launchappandwait (srcdir^ "Path.bat", source,wait);

if (launchappandwait (installdir^ "Database\\install.bat", targ,laaw_option_wait |
Laaw_option_hidden) < 0) Then
MessageBox ("Unable to launch Install.bat", SEVERE);
endif
Delay (1);
Launchappandwait (installdir^ "Createdb.bat", targ,laaw_option_wait);
Delay (2);
Launchappandwait (srcdisk^ "Test//sqlscript//setup.bat", targ,laaw_option_wait);
Delay (2);
Launchappandwait (srcdisk^ "Test//sqlscript//importdb.bat", targ,laaw_option_wait);
End
//---------------------------------------------------------------------------
The uninstalling event is sent just before the feature
Defaultfeature is uninstalled.
//---------------------------------------------------------------------------
#define Uninstall_bat installdir^ "Database\\deinstall.bat"
#define Uninstall_bak "Deinstall.bak"
Export prototype defaultfeature_uninstalling ();
function defaultfeature_uninstalling ()
STRING Targ,source;
STRING Dbpath,data,datasur,title;
Begin
Load the batch file to be edited.
if (Batchfileload (Uninstall_bat) < 0) Then
MessageBox ("Unable to load" + example_bat+ ".", SEVERE);
Abort
endif
DBPATH = srcdisk + "\ \";
Add the line SET PATH = srcdisk^ "Test".
if (Batchadd ("Sourpath", DBPATH, "", before) < 0) Then
MessageBox ("Second Call to Batchadd failed", WARNING);
Abort
endif

Save the updated file; Back up the original file.
if (Batchfilesave (Uninstall_bak) < 0) Then
MessageBox ("Unable to save" + Uninstall_bak + ".", SEVERE);
Else
MessageBox ("Batch file saved. Backup created. ", information);
endif
Datasur = "c:\\";
DATA = srcdisk^ "Test";
TITLE = "Path buffer example";
Pathset (Datasur);
Sprintfbox (Information,title,
"The starting search path is%s.", Datasur);
if (Pathadd (DATA, "", full, before) < 0) Then
MessageBox ("Unable to add DATA path to path buffer.", SEVERE);
Abort
endif
Pathget (Datasur);
Sprintfbox (Information,title,
"DATA Path added before first path.\n\nthe search Path is%s.",
Datasur);
Targ = installdir^ "Database";
SOURCE = srcdisk^ "Test";

Launchappandwait (srcdir^ "Path.bat", source,wait);
if (launchappandwait (installdir^ "Database\\deinstall.bat", targ,laaw_option_wait |
Laaw_option_hidden) < 0) Then
MessageBox ("Unable to launch Deinstall.bat", SEVERE);
endif
End


Next: Solve the problem of residual target folder during uninstallation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.