///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Setup script for Whistler Setup.
//
// Setup program assumes that setup program and script file has same file body name. That is, if setup 
// program is named "setup.exe", script file name must be "setup.ini", if setup program is named 
// "wissetup.exe", script file name must be "wissetup.ini", and so on.
//
// - We have some commands as used below. For detail usage about each command, please refer comment at 
//   where each command is used.
// - Some commands have call sequence restriction. Also these information is provided in below comments.
// - We can use common environment variable in command argument for file path. Also, Following additional 
//   environment variable are defined by setup program:
//      - SETUPSOURCE: refers to directory in where setup program resides.
//      - SETUPEXE:    refers to file name (not full path) for setup program.
//      - SETUPINF:    refers to file name (not full path) for setup inf file.
//      - SYSTEMDIR:   refers to system directory.



///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Turn on error logging. Basically we have to remove all errors in script.

// ErrorLogOn:


///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Initialize setup program. For example, setup current package version of this setup.

SetupDefaultParameters:
SetVersion:8.1.0.2427

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Add source file path to FileList.
// Syntax:
//    FileList:<SourceFilePath>
//
// Files in FileList will be removed when setup is aborted.
// All files except setup program/setup script should be listed up.

// Files to be installed into system directory.
FileList:%SYSTEMDIR%\imjp81.IME
FileList:%SYSTEMDIR%\imjp81K.DLL
FileList:%SYSTEMDIR%\IMESHARE.DLL

// Files to be installed into Help directory.
FileList:%WINDIR%\ime\imjp8_1\Help\VOICEJP.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\VOICEENG.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPCL.HLP
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPCL.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPCLE.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPCLE.HLP
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPSM.HLP
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPSM.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPSME.HLP
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPSME.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPTU.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPPD.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPDT.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\IMJPDTE.CHM
FileList:%WINDIR%\ime\imjp8_1\Help\JPNPADEN.CHM

// Files to be installed into IME directory.
FileList:%WINDIR%\ime\Shared\IMEPADSV.EXE
FileList:%WINDIR%\ime\Shared\IMEPADSM.DLL
FileList:%WINDIR%\ime\Shared\IMLANG.DLL
FileList:%WINDIR%\ime\Shared\IMEPADEN.HLP

// Files to be installed into IME\1041 directory
FileList:%WINDIR%\ime\res\PADRS411.DLL

// Files to be installed into IMEJP directory.
FileList:%WINDIR%\ime\imjp8_1\CPLEXE.EXE
FileList:%WINDIR%\ime\imjp8_1\DICJP.BIN
FileList:%WINDIR%\ime\imjp8_1\DICJP.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPCIC.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPCUS.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPDCT.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPDCT.EXE
FileList:%WINDIR%\ime\imjp8_1\IMJPLM.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPMIG.EXE
FileList:%WINDIR%\ime\imjp8_1\IMJPRW.EXE
FileList:%WINDIR%\ime\imjp8_1\IMJPUEX.EXE
FileList:%WINDIR%\ime\imjp8_1\IMJPUTY.EXE
FileList:%WINDIR%\ime\imjp8_1\IMJPUTYC.DLL
FileList:%WINDIR%\ime\imjp8_1\IMJPDSVR.EXE

// Files to be installed into Dicts directory.
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPCH.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPLN.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPNM.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPSB.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPTK.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPZP.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPGN.GRM
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPST.DIC
FileList:%WINDIR%\ime\imjp8_1\Dicts\IMJPCD.DIC

// Files to be installed into Applets directory.
FileList:%WINDIR%\ime\imjp8_1\Applets\HWXJPN.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\MULTIBOX.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\IMSKDIC.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\IMSKF.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\SOFTKEY.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\VOICEPAD.DLL
FileList:%WINDIR%\ime\imjp8_1\Applets\VOICESUB.DLL

// Per user setup - migrations
FileList:%WINDIR%\ime\imjp8_1\IMJPMIG.EXE


///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Terminate setup if newer version of product has already been installed.
// If we use this command, we have to run <SetupDefaultParameters> and all <FileList> command before it.
PreSetupCheck:

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Some per system setup
///////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Create dir
//
CreateDirectory: %WINDIR%\IME
CreateDirectory: %WINDIR%\IME\IMJP8_1
CreateDirectory: %WINDIR%\IME\IMJP8_1
//CreateDirectory: %WINDIR%\IME\IMJP8_1\UsrDicts

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Syntax:   RegisterIME: <Full path to IME file>, <Layout Text>
//RegisterIME: %SYSTEMDIR%\imjp81.ime, Microsoft IME 2002(WH), 

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Syntax:   RegisterIMEandTIP: <Full path to IME file>, <Layout Text>, <Full path of TIP file>
//RegisterIMEandTIP: %SYSTEMDIR%\imjp81.ime, Microsoft IME 2002(WH), %WINDIR%\ime\imjp8_1\IMJPCIC.DLL

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Syntax:   RegisterTIP: <Full path to IME file>, <Full path of TIP file>
RegisterTIP: %SYSTEMDIR%\imjp81.ime, %IMEDIR%\imjp8_1\IMJPCIC.DLL

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Syntax:   RegisterActiveSetup: <Stub path>, <Display string>
//RegisterActiveSetup: %SETUPSOURCE%\%SETUPEXE%, Installing Microsoft IME 2002

///////////////////////////////////////////////////////////////////////////////////////////////////////////
RegisterPackageVersion:
//

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Adjust IMEPad applet order
//
RegisterPadOrder:

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Register dirs
//
//RegisterDirectories:

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// IMEShare
//
SetIMEShareRegistry:

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Register Helps
//
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,VOICEJP.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,VOICEENG.CHM
RegisterHLP:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPCL.HLP
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPCL.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPCLE.CHM
RegisterHLP:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPCLE.HLP
RegisterHLP:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPSM.HLP
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPSM.CHM
RegisterHLP:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPSME.HLP
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPSME.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPTU.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPPD.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPDT.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,IMJPDTE.CHM
RegisterCHM:%SYSWINDIR%\ime\imjp8_1\Help\,JPNPADEN.CHM

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Register Interfaces
//
RegisterInterface: %SYSTEMDIR%\IMJP81K.DLL
RegisterInterface: %IMEDIR%\Shared\IMEPADSV.EXE
RegisterInterface: %IMEDIR%\Shared\IMEPADSM.DLL
RegisterInterface: %IMEDIR%\Shared\IMLANG.DLL
RegisterInterface: %IMEDIR%\imjp8_1\IMJPLM.DLL
RegisterInterface: %IMEDIR%\imjp8_1\Applets\MULTIBOX.DLL
RegisterInterface: %IMEDIR%\imjp8_1\Applets\SOFTKEY.DLL
RegisterInterface: %IMEDIR%\imjp8_1\Applets\IMSKF.DLL
RegisterInterface: %IMEDIR%\imjp8_1\Applets\IMSKDIC.DLL
RegisterInterface: %IMEDIR%\imjp8_1\Applets\VOICEPAD.DLL

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// MakeSIDList - make user list for next run (B phase)
//
MakeSIDList:

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// RegisterRUNKey - set RUN key
// 
//
RegisterRUNKey: IMJPMIG8.1, "%IMEDIR%\imjp8_1\IMJPMIG.EXE" /Spoil /RemAdvDef /Migration32

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// PrepareMigration - MakeSIDList and RegisterRunKey with condition
// 
//
//PrepareMigration: IMJPMIG8.1, %IMEDIR%\imjp8_1\IMJPMIG.EXE /Spoil /RemAdvDef /Migration32
