home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98B.iso
/
Lotus
/
FRENCH
/
INSTALL1.DSK
/
LWP.LSS
< prev
next >
Wrap
Text File
|
1997-06-27
|
155KB
|
4,054 lines
'/*********************************************************************
''
'' Module Name: LWP.lss
''
'' Module Code: COMINST
''
'' Author:
''
'' Creation Date: Jan 26, 1994
''
'' Copyright Lotus Development Corporation, (c) 1994
''
''
''
'' Description:
''
''
'' Additional authors:
''
'' Change History:
'' $Log: lwp.lss $
''
'' ***
'' *** Full list of CIT changes chronicled in xxx.lss ***
'' ***
''
'' Rev 1.0 11 Feb 1994 10:53:40 jbrodeur
'' Initial Revision
''----------------------------------------------------------------------
'' Date Vers. Pgmr SPR# Change
''----------------------------------------------------------------------
'' !
'' 02-07-94 0000 Initial Product Shipment
''
''----------------------------------------------------------------------
''
''*********************************************************************/
'** This file contains detailed comments. PLEASE READ THEM! They provide
'** information that will make writing Install much easier. In some
'** cases, you will not find this information in any other sources.
''*********************************************************************/
'**
USE "TOOLKIT"
USE "LANGUAGE"
OPTION DECLARE
DIM InstalledLWPVersion$
DIM LWPBackupSmartMasters%, LWPDisableOLE%, LWPRemoveProdFiles%
DIM LWPProductNumber%
DIM notused%
CONST MAX_NO_DRIVECOMBOS = 5
CONST gDebugDirs = 0
CONST gDebugMsg1 = 0
CONST gDebugMsg2 = 0
'** These Are the Required Functions that Products must provide
'***************************************************************
DECLARE PUBLIC FUNCTION ProductRegLWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION DefaultUserRegLWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION InitLWP (prodno%, network$, direction$, basedir$) AS STRING
DECLARE PUBLIC FUNCTION PrevVersionsLWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION PathChangeLWP (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
DECLARE PUBLIC FUNCTION InitCopyListLWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION PreCopyConfigLWP (prodno%, network$, direction$, lic%) AS STRING
DECLARE PUBLIC FUNCTION AddTheBillBoardsLWP (prodno%, network$, direction$, nbytes&) AS STRING
DECLARE PUBLIC FUNCTION PostCopyConfigLWP (prodno%, network$, direction$, programgroup$) AS STRING
DECLARE PUBLIC FUNCTION AddIconsLWP (prodno%, network$, direction$, programgroup$) AS STRING
DECLARE PUBLIC FUNCTION UILWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION PostSuccessRegLWP (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC SUB AddRegistryKeysLWP (prodno%, network$)
DECLARE PUBLIC FUNCTION InitLanguageLWP (prodno%, network$, direction$) AS STRING
DECLARE FUNCTION DetectPreviousVersion (Productfound$) AS STRING
DECLARE SUB LWPRemoveObsoleteFiles (hDlg&, CtrlId%, Classes$, LInst&)
'** Product specific functions
'*****************************
DECLARE SUB LWP_DoFontProcessing()
DECLARE SUB LWP_RegisterOCXs(prodno%)
DECLARE SUB LWP_RegUninstallHTML()
DECLARE SUB LWP_RegBasicUninstReg (key$)
DECLARE SUB LWP_RegCLSID (clsid$)
DECLARE SUB WriteLotusIni(network$, prodno%)
DECLARE SUB WriteLWPIni(network$, prodno%)
DECLARE SUB WriteLWPUserIni(network$, prodno%)
DECLARE SUB AddMRUSmartMaster(prodno%, Section$, File$)
DECLARE SUB LWPMOREDIRSCB(hDlg&, CtrlId%, Classes$, LInst&)
DECLARE SUB LWPBACKUPMASTERSCB(hDlg&, CtrlId%, Classes$, LInst&)
DECLARE SUB LWPDISABLEOLECB(hDlg&, CtrlId%, Classes$, LInst&)
DECLARE SUB LWPRemoveProdFilesCB(hDlg&, CtrlId%, Classes$, LInst&)
DECLARE FUNCTION GetInstalledLWPVersion(network$) AS STRING
DECLARE FUNCTION GetDefaultPath(DirName$, basedir$) AS STRING
DECLARE FUNCTION LWP_IsSameInstallType(VerNum$)
DECLARE FUNCTION GetPreviousMastersDir() AS STRING
DECLARE FUNCTION GetPreviousWorkDir() AS STRING
DECLARE FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
DECLARE SUB LWP_DoBackupSmartMasters()
DECLARE SUB LWP_RegisterHelpFile(prodno%, Feature$, HelpFile$)
DECLARE SUB LWP_RegShrComponent(Feature$, CompKey$, CompVer$)
DECLARE SUB LWP_AddRegPathKey(key$, path$)
DECLARE SUB LWP_AddInstalledPathKey(dirsym$)
DECLARE SUB LWP_RegeditFile(Path$, RegFile$)
DECLARE SUB LWP_WriteUserPaths(network$)
DECLARE SUB LWP_FixupTourPath(network$, prodno%)
DECLARE SUB LWP_FixupGraphicsPath(network$, prodno%)
DECLARE SUB LWP_FixupBackgroundsPath(network$)
DECLARE SUB LWP_FixupSmastersPath ()
DECLARE SUB LWP_RemoveOldShortcuts()
DECLARE SUB LWP_RemoveFile(fname$)
DECLARE SUB LWP_RegisterGIDFile(ProgDir$, gid$)
DECLARE SUB LWP_SavePrevUserSettings(oldkey$, newkey$, flag%)
DECLARE SUB LWP_FinishSavePrevUserSettings()
DECLARE SUB LWP_DispatchRegCopy(hkey$, oldkey$, newkey$, copy$)
DECLARE FUNCTION LWPLFN2SFN(FilePath$) AS STRING
DECLARE FUNCTION LWP_IsChapterIn(chapter$)
DECLARE FUNCTION LWP_SetChapterInOut(chapter$, inout%)
DECLARE SUB CheckLangForBackgroundSpell()
DECLARE SUB DisableBackgroundSpell()
DECLARE SUB DebugMsg1(msg$)
DECLARE SUB DebugMsg2(msg$)
DECLARE SUB DebugDirs()
'' Needed while we define Lot_AddFontByID
DECLARE SUB Lot_AddFontByID(Section$, FontFile$, FontNameID%)
'** External functions
'*****************************
DECLARE PUBLIC FUNCTION GetInitials LIB "lwpinst.dll" _
ALIAS "GetInitials" (BYVAL UserName$, BYVAL Initials$) AS INTEGER
DECLARE PUBLIC FUNCTION GetBinType LIB "lwpinst.dll" _
ALIAS "GetBinType" (BYVAL Executable$) AS INTEGER
DECLARE PUBLIC FUNCTION GetPhysicalMemoryInMB LIB "lwpinst.dll" _
ALIAS "GetPhysicalMemoryInMB" () AS INTEGER
DECLARE PUBLIC FUNCTION KillQuickStart LIB "lwpinst.dll" _
ALIAS "KillQuickStart" () AS INTEGER
DECLARE PUBLIC FUNCTION FixAppPath LIB "lwpinst.dll" _
ALIAS "FixAppPath" (BYVAL RegFile$, BYVAL NewPath$) AS INTEGER
DECLARE PUBLIC FUNCTION SetInternetProxies LIB "lwpinst.dll" _
ALIAS "SetInternetProxies" () AS INTEGER
DECLARE PUBLIC FUNCTION RegCopy LIB "lwpinst.dll" _
ALIAS "RegCopy" (BYVAL lpBaseKey$, BYVAL lpKey1$, BYVAL lpKey2$) AS INTEGER
DECLARE PUBLIC FUNCTION FindWindowA LIB "user32" _
ALIAS "FindWindowA" _
(BYVAL lpszClassName AS ANY, BYVAL lpCaption AS ANY) AS LONG
DECLARE PUBLIC FUNCTION Win32GetShortPathName LIB "kernel32" _
ALIAS "GetShortPathNameA" _
(BYVAL LFN$, BYVAL SFN$, BYVAL bufSize&) AS LONG
DECLARE PUBLIC FUNCTION RegDeleteValueA LIB "advapi32" _
ALIAS "RegDeleteValueA" _
(ByVal hKey&, ByVal szValueName$) AS LONG
'' Needed while we define Lot_AddFontByID
DECLARE PUBLIC FUNCTION AddFontResource LIB "gdi32.dll" _
ALIAS "AddFontResourceA" (BYVAL FontFile$) AS LONG
''
'' Language functions for CheckBackgroundSpell
''
DECLARE PUBLIC FUNCTION GetSysDefLangID LIB "lwpinst.dll" _
ALIAS "GetSysDefLangID" () AS INTEGER
DECLARE PUBLIC FUNCTION GetPrimLangID LIB "lwpinst.dll" _
ALIAS "GetPrimLangID" (BYVAL langID) AS INTEGER
DECLARE PUBLIC FUNCTION GetSubLangID LIB "lwpinst.dll" _
ALIAS "GetSubLangID" (BYVAL langID) AS INTEGER
DECLARE PUBLIC FUNCTION GetLangID_English LIB "lwpinst.dll" _
ALIAS "GetLangID_English" () AS INTEGER
DECLARE PUBLIC FUNCTION GetLangID_French LIB "lwpinst.dll" _
ALIAS "GetLangID_French" () AS INTEGER
DECLARE PUBLIC FUNCTION GetLangID_Spanish LIB "lwpinst.dll" _
ALIAS "GetLangID_Spanish" () AS INTEGER
DECLARE PUBLIC FUNCTION GetLangID_Portuguese LIB "lwpinst.dll" _
ALIAS "GetLangID_Portuguese" () AS INTEGER
DECLARE PUBLIC FUNCTION GetSubLangID_Australian LIB "lwpinst.dll" _
ALIAS "GetSubLangID_Australian" () AS INTEGER
'*************************************************************************
'**************************** Required Functions *************************
'*************************************************************************
'*************************************************************************
'** SUB Initialize
'**
'** Purpose: The only purpose of this routine is to register your product.
'** This routine assigns your acronym to your product.
'** Without this function, your product will not install.
'** All you need to do in this subroutine is:
'** modify LWP -> your acronym.
'**
'** ASSUMPTIONS: Many things in the toolkit key off of your
'** acronym. These are the constraints:
'** 1. Your top level chapter in the INF must
'** have a KEYWORD of your acronym +"TOP"
'** e.g. acronymTOP
'** Author: Marcel Meth
'** Arguments: None
'** Returns: NONE
'*************************************************************************
SUB Initialize
Reg_RegisterProductNames "LWP", LdString(SID_LWP)
END SUB
'*************************************************************************
'** FUNCTION ProductRegLWP (prodno%, network$, direction$) AS INTEGER
'**
'** Purpose: This function allows your product to register itself
'** in the Install Product Registry. The toolkit stores
'** the information provided and will provide you with
'** various features accordingly. For example, if you support
'** shared files, the toolkit will do most of the work
'** for the LOTUSAPP directory.
'**
'** For the most part you should use only Reg_Set... Functions.
'**
'**
'** If you turn on ATM, LICENSING, or SHARED tools, then
'** you must be sure to add the appropriate lines and files
'** in your acronym.SCR and acronym.LYT, respectively.
'** See Cookbook.
'**
'** If you support server install, (because you need the files
'** for Licenser), you will have to make sure that you have
'** the correct **entire** contents of install.lyt and install.scr
'** for the install files in your acronym.SCR and acronym.LYT
'**
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: UNINITIALIZED
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards, i.e start at your last dialog
'** first.
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'*************************************************************************
PUBLIC FUNCTION ProductRegLWP (prodno%, network$, direction$) AS STRING
ProductRegLWP = gNEXT
'DebugMsg1 "entering productreglwp"
'** FOR a complete set of things to register
'** see API doc under Reg_Set...
Reg_SetSupportedInstallTypes prodno%, 1, 1, 1
'** Set the size of the minimum and default installs
If network$ = gNODE$ Then
Reg_SetProdSizes prodno%, 0 * 1024, 0 * 1024
Else
Reg_SetProdSizes prodno%, 50 * 1048576, 25 * 1048576
End If
'** If you need Components directory turn this on.
Reg_SetShare32Flag prodno%, 1
'** Coming soon to an install program near you
'Reg_SetCDOption prodno%,Inst%,CDOptStr$
'Reg_SetCDOptionSelected ProdNo%,Inst%,Selection%
Reg_SetNodeOption prodno%,1,"LWP_SMARTMASTERS"
Reg_SetNodeOptionSelected prodno%,1,1
Reg_SetNodeOption prodno%,2,"LWP_SAMPLEDOCS"
Reg_SetNodeOptionSelected prodno%,2,1
Reg_SetNodeOption prodno%,3,"LWP_TRUETYPEFONTS"
Reg_SetNodeOptionSelected prodno%,3,1
'** Toolkit default is for no server supprt, turn on if desired.
Reg_SetSrvSupport prodno%, 1
'** This is the default value the user will see.
Reg_SetProgManagerGroup prodno%, LdString(SID_LWP_LOTUSSMARTSUITE)
'** Required if you have a work, smartmasters and backup directories
'** register support with the toolkit to surface the dialog
Reg_SetMoreDirsData prodno%, "LWPMOREDIRSCB", _
DBLWP_MOREDIRS3, DBLWP_MOREDIRS3
Reg_SetUIInOrOut prodno%, 1
'DebugMsg1 "leaving productreglwp"
END FUNCTION
'*************************************************************************
'** FUNCTION DefaultUserRegLWP (prodno%, network$, direction$) AS STRING
'**
'** Purpose: **Only** the first registered product gets called.
'** For SmartSuite, this will be SmartSuite.
'** This function allows you to set the default user registration
'** information that the user will be shown. The toolkit
'** will provide default values from MS-Windows. If you disagree
'** with them you should modify them in this function using:
'** SetSymbolValue on SYM_NAME, SYM_COMPANY & SYM_SERIALNUM$
'**
'** It is up to you how you store registration information.
'** It will not be stored until later in PostCopyConfigLWP.
'** The CIT provides functions that allow you to access .ri
'** files: Lot_ReadDefaultsfromRi(ripath$).
'**
'** If you need to write back to the floppy, do it here.
'** Most Lotus products will no longer write back to the floppy.
'** Remeber, you can't write back to a CD or network!
'**
'** In Symbols : SYM_NAME$, SYM_COMPANY$
'** Out Symbols: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: UNINITIALIZED
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'**
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards, i.e start at your last dialog
'** first.
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'*************************************************************************
PUBLIC FUNCTION DefaultUserRegLWP (prodno%, network$, direction$) AS STRING
DefaultUserRegLWP = gNEXT
' Just accept Windows defaults if not previous Word Pro install
'
InstalledLWPVersion$ = GetInstalledLWPVersion(network$)
IF InstalledLWPVersion$ <> "WORDPRO32" AND _
InstalledLWPVersion$ <> "WORDPRO16" _
THEN
EXIT FUNCTION
END IF
DIM LotusIni$, Executable$, pos%
LotusIni$ = GetWindowsDir() + "lotus.ini"
Executable$ = GetIniKeyString(LotusIni$, "Lotus Applications", "WordPro")
pos% = INSTR(Executable$, " ")
IF pos% <> 0 THEN
Executable$ = MID$(Executable$, 1, pos% - 1)
END IF
IF DoesFileExist(Executable$, femExists) = FALSE THEN EXIT FUNCTION
pos% = INSTR(UCASE$(Executable$), "WORDPRO.EXE")
IF pos% = 0 THEN EXIT FUNCTION
DIM riFile$
riFile$ = MID$(Executable$, 1, pos% - 1) + "wordpro.ri"
IF DoesFileExist(riFile$, femExists) = FALSE THEN EXIT FUNCTION
'' RETURNS TRUE IF SUCCESSFULLY FOUND RI FILE AND READ INFORMATION
'' This functions populates: SYM_NAME$, SYM_COMPANY$, SYM_SERIALNUM$
DIM rc%
rc% = Lot_ReadDefaultsfromRi(riFile$)
' Now that we have something for user name and company, try to do
' better by checking the registry
DIM UserName$, Company$
DIM buff$, LWPKey$, Key$, regStr$, Value$
buff$ = STRING$(256, 0)
LWPKey$ = "Software\Lotus\WordPro\97.0\"
Key$ = LWPKey$ + "lwpuser.ini\WordProUser"
Value = "UserName"
IF Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, Key$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
Value$, REG_SZ, buff$, 256)
IF rc% = 0 THEN
UserName$ = buff$
END IF
END IF
Value = "CompanyName"
IF Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, Key$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
Value$, REG_SZ, buff$, 256)
IF rc% = 0 THEN
Company$ = buff$
END IF
END IF
IF UserName$ <> "" THEN
SetSymbolValue SYM_NAME$, UserName$
END IF
IF (Company$ <> "") AND (network$ = gSTANDARD) THEN
SetSymbolValue SYM_COMPANY$, Company$
END IF
END FUNCTION
'*************************************************************************
'** FUNCTION InitLWP (prodno%, network$, direction$, basedir$) AS STRING
'**
'** Purpose: This function will be called after the Welcome dialog has been
'** filled in by the user. This is the first time you will be
'** called when the server parameter is valid.
'** You need to use this function to intialize certain things.
'** (See the MUST DO below).
'**
'** This is a good place to put up a LotusScript messagebox warning the user
'** of a previous version of your product. If there is a previous
'** version you might want to steer them towards overwriting it,
'** deleting the old version, or allowing both versions to exist.
'**
'**
'** Must Do: You **MUST** set inital values for all of the destination
'** ======= directories that you refer to in your INF file. If you do not,
'** then InitCopylist will fail! e.g. SetSymbolValue "LWPDIR", basedir$
'** Of course you may be more intelligent. You should preface your
'** directory with basedir$. The toolkit is finding a good drive
'** letter and basedirectory. Also, remeber all paths end in a
'** \ and are lower case.
'**
'** You should **NOT** define LOTUSAPPDIR, NETLOTUSAPPDIR, WINDIR,
'** USERDIR & WINSYSDIR. The toolkit does this for you.
'**
'** Once you have defined destdir symbols, you need to register
'** them with the toolkit. (See the code below)
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'**
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards, i.e start at your last dialog
'** first.
'**
'** basedir$: The toolkit has found a good base. for your directory.
'** This is it. You should use it. This will make Smart
'** Suite work, and will pick a good drive letter for you.
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION InitLWP (prodno%, network$, direction$, basedir$) AS STRING
DIM sym$, symname$, defdir$, position%, proddir$, iniPath$, rv%, LWPversion$
DIM Productfound$,previousprod$,temp%
'DebugMsg1 "entering initlwp"
InitLWP = direction$
'' In the backwards case, keep backing up
If InitLWP = gBACK Then
EXIT FUNCTION
End If
'------------------------------
'** Set product size for server
'
If network$ = gSERVER$ Then
Reg_SetProdSizes prodno%, 85 * 1048576, 16 * 1048576
End if
' Look and see if Word Pro is already running.
' ============================================
DIM hwnd&
hwnd& = FindWindowA("WordProAppWndNT", 0&)
WHILE (direction$ = gNEXT$ AND hwnd& <> FALSE)
direction$ = PopupModalDlg(DBLWP_RUNNING, DBLWP_RUNNING)
IF direction$ = gBACK$ then
InitLWP = direction$
EXIT FUNCTION
END IF
hwnd& = FindWindowA("WordProAppWndNT", 0&)
WEND
'--------------------------------------------------
'** Check for previous version. Put up dialog box.
'
' SDB 8/30/96
' Note:
' Double check to see if the Word Pro registry entry exists.
' This saves us from getting fooled by lotus.ini pointing
' to an exe on the server even after the node has been uninstalled.
'
InstalledLWPVersion$ = GetInstalledLWPVersion(network$)
IF InstalledLWPVersion$ = "WORDPRO32" AND _
Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, "Software\Lotus\WordPro\") _
THEN
If GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ then
Reg_SetPreviousVersion prodno%,"1"
else
direction$ = PopupModalDlg (DBLWP_EXISTING, DBLWP_EXISTING)
If direction$ = gBACK Then
InitLWP= direction$
EXIT FUNCTION
End if
End if
END IF
'** Set flag to remove obsolete files
'
IF InstalledLWPVersion$ = "AMIPRO" OR _
InstalledLWPVersion$ = "WORDPRO16" _
THEN
Reg_SetObsFiles prodno%, 1
ELSE
Reg_SetObsFiles prodno%, 0
END IF
'** Set obsolete directory name
'
DIM LotusIni$, ObsProdDir$, ExePath$, pos%
LotusIni$ = GetWindowsDir() + "LOTUS.INI"
ExePath$ = GetIniKeyString(LotusIni$, "Lotus Applications", "AmiPro")
SELECT CASE InstalledLWPVersion$
CASE "AMIPRO"
pos% = INSTR(UCASE$(ExePath$), "AMIPRO.EXE")
CASE "WORDPRO16"
pos% = INSTR(UCASE$(ExePath$), "WORDPRO.EXE")
CASE ELSE
pos% = 0
END SELECT
IF pos% <> 0 THEN
ObsProdDir$ = MID$(ExePath$, 1, pos% - 1)
IF DoesDirExist(ObsProdDir$) THEN
SetSymbolValue "LWPOBSDIR1", ObsProdDir$
END IF
ELSE
SetSymbolValue "LWPOBSDIR1", "SOMETHING" '' ** Must have some value
END IF
LWPBackupSmartMasters% = FALSE
LWPDisableOLE% = FALSE
LWPRemoveProdFiles% = FALSE
'' Setup Default directory settings and the associated
'' text that the user will see
'' *****************************************************************
'' *** Register Directory symbols here IFF they are in the .rsp file
'' *****************************************************************
''
sym$ = Reg_GetDirSymbolList(prodno%)
symname$ = sym$ + gNAME
SetListItem sym$, 1, "LWPDIR"
SetListItem symname$, 1, "LWPDIRNAME"
SetListItem sym$, 2, "LWPWORKDIR"
SetListItem symname$, 2, "LWPWORKDIRNAME"
SetListItem sym$, 3, "LWPSCRIPTSDIR"
SetListItem symname$, 3, "LWPSCRIPTSDIRNAME"
SetListItem sym$, 4, "LWPMASTERSDIR"
SetListItem symname$, 4, "LWPMASTERSDIRNAME"
SetListItem sym$, 5, "LWPICONDIR"
SetListItem symname$, 5, "LWPICONDIRNAME"
SetListItem sym$, 6, "LWPGRAPHICSDIR"
SetListItem symname$, 6, "LWPGRAPHICSDIRNAME"
SetListItem sym$, 7, "LWPSAMPLESDIR"
SetListItem symname$, 7, "LWPSAMPLESDIRNAME"
SetListItem sym$, 8, "LWPBACKUPDIR"
SetListItem symname$, 8, "LWPBACKUPDIRNAME"
' SetListItem sym$, 6, "LWPTOURDIR"
' SetListItem symname$, 6, "LWPTOURDIRNAME"
'' SetListItem sym$, 10, "LWPBACKGROUNDSDIR"
'' SetListItem symname$, 10, "LWPBACKGROUNDSDIRNAME"
'' Special Cases for setting these symbols
'' Strings should be resourced, but we didn't want to clutter
'' the LWP string table.
SELECT CASE network$
CASE gSERVER$
SetSymbolValue "LWPNAME", LdString(SID_LWP_SERVER_DIRNAME)
CASE gDISTRIBUTION$
SetSymbolValue "LWPNAME", LdString(SID_LWP_DIST_DIRNAME)
CASE gSTANDARD$
'Handled below
CASE gNODE$
'Handled below
'SetSymbolValue "LWPDIR", GetDefaultPath("WORDPRO", basedir$)
END SELECT
SetSymbolValue "LWPDIR", GetDefaultPath("WORDPRO", basedir$)
SetSymbolValue "LWPLANGDIR", GetSymbolValue("LWPDIR")
SetSymbolValue "LWPDIRNAME", LdString(SID_LWP_DIRNAME)
SetSymbolValue "LWPLANGDIRNAME", LdString(SID_LWP_DIRNAME)
IF GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ THEN
basedir$ = GetSymbolValue(SYM_BASEDIR$)
'' ??? Why not just use the basedir$ passed in???
END IF
SetSymbolValue "LWPWORKDIR", GetDefaultPath("WORK", basedir$)
SetSymbolValue "LWPBACKUPDIR", GetDefaultPath("BACKUP", basedir$)
SetSymbolValue "LWPSCRIPTSDIR", GetDefaultPath("SCRIPTS", basedir$)
SetSymbolValue "LWPMASTERSDIR", GetDefaultPath("MASTERS", basedir$)
SetSymbolValue "LWPSAMPLESDIR", GetDefaultPath("SAMPLES", basedir$)
SetSymbolValue "LWPICONDIR", GetDefaultPath("ICONS", basedir$)
'' SetSymbolValue "LWPTOURDIR", GetDefaultPath("TOUR", basedir$)
SetSymbolValue "LWPGRAPHICSDIR", GetDefaultPath("GRAPHICS", basedir$)
'' SetSymbolValue "LWPBACKGROUNDSDIR", GetDefaultPath("BACKGROUNDS", basedir$)
SetSymbolValue "LWPWORKDIRNAME", LdString(SID_LWP_WORK_DIRNAME)
SetSymbolValue "LWPSAMPLESDIRNAME", LdString(SID_LWP_SAMPLES_DIRNAME)
SetSymbolValue "LWPBACKUPDIRNAME", LdString(SID_LWP_BACKUP_DIRNAME)
SetSymbolValue "LWPSCRIPTSDIRNAME", LdString(SID_LWP_SCRIPTS_DIRNAME)
SetSymbolValue "LWPMASTERSDIRNAME", LdString(SID_LWP_MASTERS_DIRNAME)
SetSymbolValue "LWPICONDIRNAME", LdString(SID_LWP_ICON_DIRNAME)
'' SetSymbolValue "LWPTOURDIRNAME", LdString(SID_LWP_TOUR_DIRNAME)
SetSymbolValue "LWPGRAPHICSDIRNAME", LdString(SID_LWP_GRAPHICS_DIRNAME)
'' SetSymbolValue "LWPBACKGROUNDSDIRNAME", LdString(SID_LWP_BACKGROUNDS_DIRNAME)
'' Mark directory symbols that need source file adjustment
'' Bare filename in .inf file, symbol will be set to the installed location
'' on the server obtained by reading the server cinstall.ini file
'' This is needed for files that are located in a sibling directory to the
'' product directory, e.g., SmartMasters, which would be installed:
'' \Lotus\
'' \Lotus\smasters
'' \Lotus\XXX
MarkFixupSourceDirSymbol("LWPWORKDIR")
MarkFixupSourceDirSymbol("LWPMASTERSDIR")
MarkFixupSourceDirSymbol("LWPSAMPLESDIR")
'' Mark directory symbols that are LANGUAGE dependent. CIT will add the
'' appropriate language subdirectory to the files in the copy list for
'' destinations for a language install, and source if a server install of a
'' secondary language on the SERVER
MarkLanguageSubdir("LWPLANGDIR")
MarkLanguageSubdir("LWPMASTERSDIR")
MarkLanguageSubdir("LWPSAMPLESDIR")
MarkLanguageSubdir("LWPICONDIR")
MarkLanguageSubdir("LWPGRAPHICSDIR")
'' MarkLanguageSubdir("LWPBACKGROUNDSDIR")
'' Removed 1/1/97 SDB
''
'' We don't mark these as MLC since they get translated (e.g. "Arbeit")
'' MarkLanguageSubdir("LWPWORKDIR")
'' MarkLanguageSubdir("LWPBACKUPDIR")
''
'' ----------------------------------------------------------------
'' Note: LWPTOURDIR and LWPBACKGROUNDSDIR
'' Even though we try to keep track of these directories, we
'' never use these symbols to determine where to copy files to.
'' These symbols are not in lwp.scr! The tour files always go
'' under LWPDIR, and the background files always go under LWPGRAPHICSDIR.
'' We keep track of them in order to WriteUserPaths. We need to
'' fix them up when we change the paths they are dependent upon.
''
'' Because of this, they shouldn't be in the instlwp.rsp file.
''
'DebugDirs
'DebugMsg1 "leaving initlwp"
END FUNCTION
'*************************************************************************
'** FUNCTION PrevVersionsLWP (prodno%, network$, direction$) AS STRING
'**
'** Purpose: This function is called only for SmartSUite. It is called
'** immediately after all the other product functions for
'** InitLWP are called. It allows SmartSuite to assess whether
'** there are older versions of products around.
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'**
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards, i.e start at your last dialog
'** first.
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION PrevVersionsLWP (prodno%, network$, direction$) AS STRING
DIM nProducts%, prodIndex%, i%
nProducts% = Reg_GetNumberOfProducts()
FOR prodIndex% = 1 to nProducts%
If Reg_GetPreviousVersion(prodIndex%) <> "" Then
i% = DoMsgBox("Older Versions Found","", MB_OK)
GOTO PREVPRODFOUND
End If
NEXT
PREVPRODFOUND:
END FUNCTION
'*************************************************************************
'** FUNCTION PathChangeLWP (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
'**
'** Purpose: This function is called whenever the user proposes changes
'** to a path for your product. By the time this function calls
'** you, the paths have already been checked syntactically, and
'** the directory has been checked to see that it is writeable.
'** Your obligation is to verify that the proposed new path is ok
'** with you. If not, put up a Lotus Script :"MESSAGEBOX"
'** telling the user and return gBACK.
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** destdirsym$: The destdir symbol that has changed. e.g. "LWPDIR"
'** mainprodsonly%: (TRUE | FALSE) , when TRUE this means that only
'** your top level product directory should change,
'** probably "LWPDIR". When it is false, it means that
'** all related directories should change. It is **YOUR
'** RESPONSIBILITY** to implement this functionality.
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION PathChangeLWP (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
PathChangeLWP = gNEXT
'DebugMsg1 "Entering Path Change"
'DebugDirs
DIM path$
IF destdirsym$ = "LWPDIR" OR destdirsym$ = GetSymbolValue("LWPDIR") THEN
path$ = GetSymbolValue("LWPDIR")
SetSymbolValue "LWPLANGDIR", path$
SetSymbolValue "LWPSCRIPTSDIR", path$ + LdString(SID_LWP_SCRIPTS_DIR)
SetSymbolValue "LWPICONDIR", path$ + LdString(SID_LWP_ICON_DIR)
'' SetSymbolValue "LWPTOURDIR", path$ + LdString(SID_LWP_TOUR_DIR)
SetSymbolValue "LWPGRAPHICSDIR", path$ + LdString(SID_LWP_GRAPHICS_DIR)
'' SetSymbolValue "LWPBACKGROUNDSDIR", _
'' GetSymbolValue("LWPGRAPHICSDIR") + LdString(SID_LWP_BACKGROUNDS_DIR)
LWP_FixupSmastersPath
Lot_RefreshDestination("LWPMASTERSDIR")
Lot_RefreshDestination("LWPLANGDIR")
Lot_RefreshDestination("LWPSCRIPTSDIR")
Lot_RefreshDestination("LWPGRAPHICSDIR")
'' Lot_RefreshDestination("LWPBACKGROUNDSDIR")
Lot_RefreshDestination("LWPICONDIR")
'' Lot_RefreshDestination("LWPTOURDIR")
END IF
'DebugDirs
'DebugMsg1 "Leaving Path Change"
END FUNCTION
'*************************************************************************
'** LWP_FixupSmastersPath
'**
'** Adjust SmastersDir to reflect change in install location
'**
'** i.e. If we install to \lotus\wordpr97\ instead of \lotus\wordpro\
'** then install smasters to ==> \lotus\smasters\wordp97
'**
'** We trim the trailing slash initially to make this work.
'** Then we tack it back on at the end.
'**
'** Author: SDB
'*************************************************************************
SUB LWP_FixupSmastersPath ()
DIM osdir$, wpdir$, p, q
osdir$ = Lot_TrimEndSlash(GetSymbolValue("LWPMASTERSDIR"))
p = 0
Do
q = p
p = Instr(p+1, osdir$, "\")
Loop While p
osdir$ = Left(osdir$, q) ' Sets osdir$ to something like "\lotus\smasters\"
wpdir$ = Lot_TrimEndSlash(GetSymbolValue("LWPDIR"))
p = 0
Do
q = p
p = Instr(p+1, wpdir$, "\")
Loop While p
wpdir$ = Mid(wpdir$, q+1) ' Sets wpdir$ to something like "wordpr97"
SetSymbolValue "LWPMASTERSDIR", osdir$ + wpdir$ + "\"
END SUB
'*************************************************************************
'** FUNCTION InitCopyListLWP (prodno%, network$, direction$) AS STRING
'**
'** Purpose: Product must Initialize the copylist
'**
'** Must Do: You must initialize the copy list. However,
'** ======= if you leave the code as is (don't touch it at all),
'** it will probably work for you. Copy list must be initialized.
'** CAUTION: Make sure that your toplevel section in the
'** acronym.SCR has a keyword of "acronymTOP"
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION InitCopyListLWP (prodno%, network$, direction$) AS STRING
DIM i%, sym$, chpt$, nextSibling$, nextprod$, notused%, FeatureToFind$
ON Error STFQUIT GOTO COPYLISTERROR
'DebugMsg1 "entering initcopylistlwp"
InitCopyListLWP = direction$
'' In the backwards case, keep backing up
If direction$ = gBACK Then
EXIT FUNCTION
End If
sym$ = Reg_GetProductAcronym(prodno%) + gTOP$
chpt$ = Lot_GetChapterFromKeyWord(sym$)
If chpt$ = "" Then
ERROR STFQUIT
End IF
SELECT CASE Reg_GetProdSelectedInstallType(prodno%)
CASE gCOMPLETE$
i% = F_COMPLETE
CASE gLAPTOP$
i% = F_LAPTOP
CASE gCUSTOM$
i% = F_CUSTOM
END SELECT
Lot_InitializeCopyList chpt$, i%
''** Make sure to turn off all sections not available on the server.
IF network$ = gNODE THEN
nextprod$ = Lot_GetNextSibling(chpt$, F_NOTHING)
chpt$ = Lot_GetFirst(chpt$, F_NOTHING)
WHILE (chpt$ <> "" AND chpt$ <> nextprod$)
FeatureToFind$ = Lot_GetChapterValStr(chpt$, F_KEYWORD)
IF Lot_IsTheFeatureInstalled(FeatureToFind$) = FALSE THEN
notused% = Lot_SetChapterFilesInCopyListInOrOut (chpt$, 0)
END IF
chpt$ = Lot_GetNext()
WEND
ELSEIF (network$ = gSERVER) AND _ ''(i% = F_COMPLETE) AND _
GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ _
THEN
''** Turn on all sections in Solo WordPro. ** Suite does it for us.
sym$ = Reg_GetProductAcronym(prodno%) & "OBSFILES1"
nextprod$ = Lot_GetNextSibling(chpt$, F_NOTHING)
chpt$ = Lot_GetFirst(chpt$, F_KEYWORD)
WHILE (chpt$ <> "" AND chpt$ <> nextprod$)
IF Lot_GetChapterValStr(chpt$, F_KEYWORD) <> sym$ THEN
notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 1)
END IF
chpt$ = Lot_GetNext()
WEND
END IF
'DebugMsg1 "leaving initcopylistlwp"
EXIT FUNCTION
COPYLISTERROR:
ERROR STFQUIT
END FUNCTION
'*************************************************************************
'** FUNCTION UILWP (prodno%, network$, direction$) AS STRING
'**
'** Purpose: This is your chance to put up any User Interface
'** that you want. Remember, try to keep it short.
'** In SmartSuite, if every product puts up two extra
'** dialogs, then the SmartSuite will consist of 16 dialogs!
'**
'** Pay attention to the value of direction, if you are putting
'** up more than one dialog.
'**
'** The toolkit will do an accurate space computation later,
'** so you can tamper with the copy list. But you shouldn't
'** write out anything to the disk until PostCopyCofig!
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is oart of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION UILWP (prodno%, network$, direction$) AS STRING
DIM notused%, chpt$, PrevMastersDir$
' If Custom and NOT part of Suite then surface dialog.
' Also check to make sure we aren't automated
'
IF Reg_GetProdSelectedInstallType(prodno%) = gCUSTOM$ AND _
GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ AND _
network$ <> gSERVER AND _
GetSymbolValue(SYM_AUTOMATIONINST$) <> gTRUE$ _
THEN
' Don't allow users to change directories in an MLC install
'
IF GetListItem(SYM_INSTALLKINDS$, prodno%) <> gLANGUAGEINSTALL$ THEN
notused% = RegisterCallback("LWP", "LWPMOREDIRSCB")
direction$ = PopupModalDlg (DBLWP_MOREDIRS3, DBLWP_MOREDIRS3)
END IF
END IF
' IF Mem <= 8MB, offer to disable OLE
'
IF (network$ = gSTANDARD$ OR network$ = gNODE$) AND _
direction$ <> gBACK AND GetPhysicalMemoryInMB() <= 8 _
THEN
IF GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN
LWPDisableOLE% = Lot_GetKeyValFromResponseFile(_
"LWP", "LWPDisableOLE") <> "0"
ELSE
notused% = RegisterCallback("LWP", "LWPDISABLEOLECB")
direction$ = PopupModalDlg(DBLWP_DISABLEOLE, DBLWP_DISABLEOLE)
END IF
END IF
'*** Remove Obsolete Files dlg for XXX
IF Reg_GetObsFiles(prodno%) <> 0 AND _
direction$ <> gBACK AND _
network$ = gSTANDARD$ AND _
GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ _
THEN
IF GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN
LWPRemoveProdFiles% = Lot_GetKeyValFromResponseFile(_
"LWP", "LWPRemovePreviousProdFiles") <> "0"
ELSE
notused% = RegisterCallback("LWP", "LWPRemoveProdFilesCB")
direction$ = PopupModalDlg(DBLWP_REMOVEPRODFILES, _
DBLWP_REMOVEPRODFILES)
IF direction$ = gBACK THEN
direction$ = gNEXT 'handle NO button
END IF
END IF
END IF
' Give user option to backup currently installed smasters
'
DIM PrevMasters$
IF InstalledLWPVersion$ <> "" AND _
network$ = gSTANDARD$ AND _
direction$ <> gBACK AND _
GetListItem(SYM_INSTALLKINDS$, prodno%) <> gLANGUAGEINSTALL$ _
THEN
PrevMastersDir$ = Lot_TrimEndSlash(GetPreviousMastersDir())
IF DoesDirExist(PrevMastersDir$) AND _
PrevMastersDir$ = Lot_TrimEndSlash(GetSymbolValue("LWPMASTERSDIR")) _ '??? 10/21/96
THEN
IF GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN
LWPBackupSmartMasters% = Lot_GetKeyValFromResponseFile(_
"LWP", "LWPBackupSmartMasters") <> "0"
ELSE
chpt$ = Lot_GetChapterFromKeyword("LWP_SMARTMASTERS")
IF (Lot_GetChapterValInt(chpt$, F_INOROUT) = 1) THEN
notused% = RegisterCallback("LWP", "LWPBACKUPMASTERSCB")
direction$ = PopupModalDlg(DBLWP_BACKUPMASTERS, _
DBLWP_BACKUPMASTERS)
END IF
END IF
END IF
END IF
UILWP = direction$
'' ??? Shouldn't this be at the top of the function???
'' In the backwards case, keep backing up
IF direction$ = gBACK THEN
EXIT FUNCTION
END IF
END FUNCTION
'*************************************************************************
'** FUNCTION PreCopyConfigLWP (prodno%, network$, direction$, lic%) AS STRING
'**
'** Purpose: This is the very last function called before the space is
'** accurately computed (to the last byte) and files are copied
'** by the toolkit. If you have any last minute changes to
'** do, this is the time to do them. example:
'** Test for monitor resolution, and turn on the chapter
'** in the copy list (a memory residident version of the INF file)
'** with the appropriate resolution.
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** lic%: TRUE | FALSE; TRUE licensing is turned on else it is off
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION PreCopyConfigLWP (prodno%, network$, direction$, lic%) AS STRING
PreCopyConfigLWP = gNEXT
DIM notused%, chpt$, chptname$, count%, sym$
'DebugMsg1 "entering precopyconfiglwp"
'DebugDirs
DIM ObsProdDir$, installDir$, cbBuf&
DIM AppName$, OldVer$, NewVer$, OldKey$, NewKey$, Value$
DIM rc%, szProd$, szVer$
'*** REMOVE PRIOR VERSION *** sdb incorporated 5/15/96
'*** This is the product name as found in the registry
AppName$ = "WordPro"
OldVer$ = "96.0"
NewVer$ = "97.0"
OldKey$ = "Software\Lotus\" + AppName$ + "\" + OldVer$ +"\"
NewKey$ = "Software\Lotus\" + AppName$ + "\" + NewVer$ +"\"
Value$ = "Path"
'***Get the directory for the version to be removed
IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, OldKey$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, OldKey$, _
Value$, REG_DWORD, ObsProdDir$, cbBuf&)
'** Never fully implemented. SDB 1/2/97
'**
'** Save Previous Registry Entries
'LWP_SavePrevUserSettings OldKey$, NewKey$, TRUE
'** Prepare the 2 paths for a string compare
installDir$ = NullTrim(GetSymbolValue("LWPDIR"))
ObsProdDir$ = NullTrim(ObsProdDir$)
IF RIGHT$(installDir$,1) <> "\" THEN installDir$ = installDir$ + "\"
IF RIGHT$(ObsProdDir$,1) <> "\" THEN ObsProdDir$ = ObsProdDir$ + "\"
IF StrCompare(installDir$, ObsProdDir$, 1) = 0 _
AND rc% = ERROR_SUCCESS THEN
notused% = RemovePriorVersion(AppName$, OldVer$)
END IF
END IF
'*** DONE REMOVING PRIOR VERSION
'-----------------------------------
' Activate Removal of obsolete files
'
IF GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ THEN
FOR count% = 1 TO 1
sym$ = "LWPOBSFILES" + LTRIM$(STR$(count%))
chpt$ = Lot_GetChapterFromKeyWord(sym$)
IF chpt$ <> "" THEN
IF LWPRemoveProdFiles% THEN
notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 1)
ELSE
notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 0)
END IF
END IF
NEXT
END IF
'----------------------------------------------
' Remove obsolete shortcuts from 16-bit install
'
If LWPRemoveProdFiles% AND _
(InstalledLWPVersion$ = "AMIPRO" OR _
InstalledLWPVersion$ = "WORDPRO16") _
Then
LWP_RemoveOldShortcuts
End if
'------------------------------------------------------------
' Only install the stub helpfile if the full one isn't chosen
'
IF LWP_IsChapterIn("LWP_SCRIPT_HELP") then
LWP_SetChapterInOut "LWP_SCRIPT_HELP_STUB", 0
END IF
IF LWP_IsChapterIn("LWP_HELPFILE") then
LWP_SetChapterInOut "LWP_HELPFILE_STUBS", 0
END IF
'-----------------------------------------------------------------
'** Don't install default smasters to node if smasters not checked
'
If (network$ = gNODE$) THEN
If LWP_IsChapterIn("LWP_SMARTMASTERS") = 0 Then
LWP_SetChapterInOut "LWP_HPTAG_SMARTMASTER", 0
LWP_SetChapterInOut "LWP_HTML_SMARTMASTER", 0
LWP_SetChapterInOut "LWP_SMARTMASTERALWAYS", 0
End If
End If
'----------------------------------
'** Install Hyphenation if any of the language tools are installed
'
If LWP_IsChapterIn("WIN32SHRSPELLPRG") OR _
LWP_IsChapterIn("LWPTHESAURUSPRG") OR _
LWP_IsChapterIn("LWPGRAMMARPRG") _
Then
LWP_SetChapterInOut "LWPHYPHENATIONPRG", 1
LWP_SetChapterInOut "LWPHYPHENATIONDATA", 1
End if
'----------------------------------
'** QuickStart: Kill it before we do anything
'
notused% = KillQuickStart()
IF LWPBackupSmartMasters% THEN LWP_DoBackupSmartMasters
''** Tell the toolkit how many billboards you will have during file copy.
''** This way the toolkit will be avle to calculate how long each billboard
''** should stay up
If network$ = gDISTRIBUTION$ Then
Reg_SetBillboardNumber prodno%, 13
ElseIf network$ <> gNODE Then
Reg_SetBillboardNumber prodno%, 12
Else
'** There's really no time for billboards in a node install
Reg_SetBillboardNumber prodno%, 1
End If
'DebugMsg1 "leaving precopyconfiglwp"
'print "DUMPING COPYLIST"
'DumpCopyList "c:\MyCopy.Lst"
'DebugDirs
END FUNCTION
'*************************************************************************
'** FUNCTION AddTheBillBoardsLWP (prodno%, network$, direction$, nbytes&)
'**
'** Purpose: This is where to add the billboards using the function:
'** AddToBillboardList. Use nbytes& as the last parameter to
'** the MS-SETUP function AddToBillboardList
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** nbytes: Determines the duration of billboard timing.
'** NOTE: Make sure to use billboard Ids that are unique to
'** your product. e.g. IDD_LWPBILLBD1_BMP &
'** DB_LWPBILLBD1_BMP
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT | gBACK (If you are showing UI and you
'** allow the user to step backwards.)
'**
'*************************************************************************
PUBLIC FUNCTION AddTheBillBoardsLWP (prodno%, network$, direction$, nbytes&) AS STRING
AddTheBillBoardsLWP = direction$
'' In the backwards case, keep backing up
If direction$ = gBACK Then
EXIT FUNCTION
End If
IF network$ = gDISTRIBUTION$ THEN
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD1_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD0,_
"_FNameOrgDlgProc@16", nbytes&
END IF
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD1_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD1,_
"_FNameOrgDlgProc@16", nbytes&
'** There's really no time for billboards in a node install
IF network$ <> gNODE$ THEN
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "NORMALFONT",7, STR$(IDC_TEXT8)
SetListItem "NORMALFONT",8, STR$(IDC_TEXT9)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD2_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD2,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD3_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD3,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD4_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD4,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD5_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD5,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD6_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD6,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "NORMALFONT",7, STR$(IDC_TEXT8)
SetListItem "NORMALFONT",8, STR$(IDC_TEXT9)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD7_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD7,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "NORMALFONT",7, STR$(IDC_TEXT8)
SetListItem "NORMALFONT",8, STR$(IDC_TEXT9)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD8_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD8,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "NORMALFONT",7, STR$(IDC_TEXT8)
SetListItem "NORMALFONT",8, STR$(IDC_TEXT9)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD9_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD9,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD10_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD10,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "NORMALFONT",3, STR$(IDC_TEXT4)
SetListItem "NORMALFONT",4, STR$(IDC_TEXT5)
SetListItem "NORMALFONT",5, STR$(IDC_TEXT6)
SetListItem "NORMALFONT",6, STR$(IDC_TEXT7)
SetListItem "NORMALFONT",7, STR$(IDC_TEXT8)
SetListItem "NORMALFONT",8, STR$(IDC_TEXT9)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD11_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD11,_
"_FNameOrgDlgProc@16", nbytes&
SetListItem "NORMALFONT",1, STR$(IDC_TEXT2)
SetListItem "NORMALFONT",2, STR$(IDC_TEXT3)
SetListItem "IDC_BMP", 1, STR$(IDD_LWP_BILLBD_TITLE_BMP)
SetListItem "IDC_BMP", 2, STR$(IDD_LWP_BILLBD12_BMP)
AddToBillboardList GetSymbolValue(SYM_CUIDLL$), DB_LWP_BILLBD12,_
"_FNameOrgDlgProc@16", nbytes&
END IF
END FUNCTION
'*************************************************************************
'** FUNCTION PostCopyConfigLWP (prodno%, network$, direction$, programgroup$) AS STRING
'**
'** Purpose: This is called just after file copy has completed.
'** This is your opportunity to do all the configuaration
'** you need. This includes:
'**
'** 1. Writing to all your ini files
'** Don't worry about ini files related to shared components
'** 2. Writing to OLE registration database
'** Don't worry about OLE registration related to shared
'** components
'** 3. Writing to any other config files you may support
'** 4. Writing out user registration information,
'** no matter how your product picks up this info
'** 5. Create any working directories
'** A working directory is one that does not contain any
'** files, thus the toolkit did not create it for you.
'**
'** NOTE: THERE are many subtleties in here if you are
'** dealing with node and CD installs. In particular,
'** you must be ***very*** careful to understand where the
'** things are that you are pointing to. They could
'** be on the node, server, or CD! This, in combination
'** with the INF file for Server/Node, is probably the
'** trickiest part of writing a quality install. When
'** configuring, you must be careful to consider what
'** happens if there is a pre-existing product on the
'** machine, in the same location or
'** another one! This is very very tricky. What happens
'** if you had a full installation previously in location C:\FOO
'** and now the user is installing a minimum installation in loaction
'** D:\FOO.
'**
'** Each and every thing you do for configuartion needs very
'** careful thought.
'**
'** WE support a function Lot_WhereIsFeature("FeatureID")
'** This currrently tells you the location of a feature
'** if the feature appears both in the SERVER.INF and the
'** NODE.INF referred to by the same Keyword ID.
'** We do not support CDs with this command yet, but we will
'** at some time.
'**
'** Also look out for writing to a file when the directory
'** doesn't exist. If the user deselected one of your
'** options, your install may still be running, but since
'** there were no files to copy into the directory
'** it wasn't created by the toolkit!
'**
'** Finally, remember that configuration files generally
'** hold the state that the user has customized earlier.
'** Sometimes you don't want to overwrite these!
'** You will primarily use three MS-SETUP functions
'** in here:
'** 1. CreateIniKeyValue (writing to ini files)
'** 2. SetRegKeyValue (writing to OLE reg DB)
'**
'** CreateProgmanGroup & ShowProgmanGroup are
'** done for you by the time you reach this
'** function.
'**
'** You will not have to do any configuration of LOTUS SHARED
'** tools. The toolkit will do this for you.
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** programgroup$: The name of the program group where the user chose to
'** install the program manager icons
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT
'**
'*************************************************************************
PUBLIC FUNCTION PostCopyConfigLWP (prodno%, network$, direction$, programgroup$) AS STRING
DIM ripath$, notused%, unused&
'DebugMsg1 "entering postcopyconfiglwp"
'DebugDirs
PostCopyConfigLWP = direction$
'' In the backwards case, keep backing up
If direction$ = gBACK Then
EXIT FUNCTION
End If
If network$ <> gNODE$ Then
SetSymbolValue SYM_CDDRIVE$, GetSymbolValue(SYM_INSTALL_SOURCE)
End If
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
' Write to RI file
ripath$ = GetSymbolValue("LWPDIR") + "wordpro.ri"
IF Lot_WriteToRiFile (ripath$) = FALSE Then
ErrorMsg SID_LWP,LdString(SID_LWP_ERR_RI) + ripath$
END IF
END IF
'------------------------------------------------------------------
'------------------------------------------------------------------
' Anything after this conditional should only be done for standard
' and node installations
'------------------------------------------------------------------
'------------------------------------------------------------------
IF network$ = gSERVER$ OR network$ = gDISTRIBUTION THEN
EXIT FUNCTION
END IF
'------------------------------------------------------------------
'------------------------------------------------------------------
'** Write the uninstaller - but only for the primary language
'
IF GetListItem(SYM_INSTALLKINDS$, prodno%) <> gLANGUAGEINSTALL$ THEN
DIM InfFile$
IF network$ = gSTANDARD$ THEN
InfFile$ = GetSymbolValue("INSTDIR") + "LWP.INF"
ELSE
IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
InfFile$ = GetSymbolValue("SUITDIR") + "LWPNODE.INF"
ELSE
InfFile$ = GetSymbolValue("LWPDIR") + "LWPNODE.INF"
END IF
END IF
notused%=Lot_RegisterUninstaller(_
LdString(SID_LWP_PROD_NAME),_
LdString(SID_LWP_PROD_VER),_
LdString(SID_LWP_SHORT_NAME),_
InfFile$,_
TRUE,FALSE, GetSymbolValue(SYM_INSTALL_LANGUAGE$),"","","")
END IF
'---------------------------------------
'
AddRegistryKeysLWP prodno%, network$
'
'---------------------------------------
'--------------------------------------------------
'** Recreate .GID file for main help on a reinstall
'
DIM MainHelp$, ExecError%, HelpFileName$
IF (GetListItem(SYM_INSTALLKINDS$, prodno%) = gREINSTALL$) AND _
(Lot_IsTheFeatureInstalled("LWP_HELPFILE") <> FALSE) _
THEN
HelpFileName$ = LdString(SID_LWP_WP1N71XX_HLP)
MainHelp$ = LWP_WhereIsFeature(prodno%, "LWP_HELPFILE", _
HelpFileName$) + HelpFileName$
IF DoesFileExist(MainHelp$, femExists) THEN
MainHelp$ = LWPLFN2SFN(MainHelp$)
ExecError% = WinExec("winhlp32 -g " + MainHelp$, SW_HIDE)
END IF
END IF
'---------------------------------------------------
'** Create directories, if they aren't there already
'
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
DIM NewDir$
NewDir$ = GetSymbolValue("LWPSCRIPTSDIR")
IF NOT DoesDirExist(Lot_TrimEndSlash(NewDir$)) THEN
CreateDir NewDir$, cmoNone
notused%=Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_DIRECTORY$, NewDir$)
END IF
NewDir$ = GetSymbolValue("LWPMASTERSDIR")
IF NOT DoesDirExist(Lot_TrimEndSlash(NewDir$)) THEN
CreateDir NewDir$, cmoNone
notused%=Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_DIRECTORY$, NewDir$)
END IF
NewDir$ = GetSymbolValue("LWPWORKDIR")
IF NOT DoesDirExist(Lot_TrimEndSlash(NewDir$)) THEN
CreateDir NewDir$, cmoNone
notused%=Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_DIRECTORY$, NewDir$)
END IF
NewDir$ = GetSymbolValue("LWPBACKUPDIR")
IF NOT DoesDirExist(Lot_TrimEndSlash(NewDir$)) THEN
CreateDir NewDir$, cmoNone
notused%=Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_DIRECTORY$, NewDir$)
END IF
END IF
'-----------------------------------------------------------
'** Create Spell directory on Node if it isn't there already
'
IF Lot_IsTheFeatureInstalled("WIN32SHRSPELLPRG") <> FALSE AND _
network$ = gNODE$ _
THEN
NewDir$ = GetSymbolValue(SYM_COMPONENTSDIR$) + _
LdString(SID_LWP_SPELL_DIR)
IF NOT DoesDirExist(Lot_TrimEndSlash(NewDir$)) THEN
CreateDir NewDir$, cmoNone
notused%=Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_DIRECTORY$, NewDir$)
END IF
END IF
'---------------------------------------------------
' Create a link to a previous work directory, if any
'
DIM PrevWorkDir$, NewWorkDir$, Link$
IF InstalledLWPVersion <> "" AND IsNewShell() THEN
PrevWorkDir$ = GetPreviousWorkDir()
NewWorkDir$ = GetSymbolValue("LWPWORKDIR")
Link$ = NewWorkDir$ + LdString(SID_LWP_PREVIOUS_WORK_DIR) + ".lnk"
IF DoesDirExist(PrevWorkDir$) AND _
DoesFileExist(Link$, femExists) = FALSE AND _
Lot_TrimEndSlash(PrevWorkDir$) <> Lot_TrimEndSlash(NewWorkDir$) _
THEN
unused& = CreateLink(PrevWorkDir$, Link$, "", "", "")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_SHORTCUT$, Link$)
END IF
END IF
'--------------------------------------------------------------
' Some other files created by the app that should be cleaned up
'
DIM ProgDir$
ProgDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "wordpro.reg")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + "panose.bin")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + "userqstn.log")
IF network$ = gNODE$ THEN
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, GetSymbolValue(SYM_COMPONENTSDIR$) + "lisdb.dat")
END IF
' SDB 8/29/97
' Register this object so that the uninstaller won't complain
' if we install the stub help file and then overwrite it with
' the real help file which has a different date.
'
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + LdString(SID_LWP_WP0N71XX_HLP) )
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + LdString(SID_LWP_WP1N71XX_HLP) )
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + LdString(SID_LWP_WP3N71XX_HLP) )
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + LdString(SID_LWP_WP4N71XX_HLP) )
' SDB 12/18/97
' Register the .gid files created by the help files
'
LWP_RegisterGIDFile ProgDir$, LdString(SID_LWP_WP0N71XX_HLP)
LWP_RegisterGIDFile ProgDir$, LdString(SID_LWP_WP1N71XX_HLP)
LWP_RegisterGIDFile ProgDir$, LdString(SID_LWP_WP3N71XX_HLP)
LWP_RegisterGIDFile ProgDir$, LdString(SID_LWP_WP4N71XX_HLP)
'-----------------------
'
LWP_DoFontProcessing
'
'-----------------------
'-----------------------
'
LWP_RegisterOCXs prodno%
'
'-----------------------
'DebugMsg1 "leaving postcopyconfiglwp"
END FUNCTION
'*************************************************************************
'** PUBLIC SUB AddRegistryKeysLWP (prodno%, network$)
'**
'** Purpose: This is called just after file copy has completed.
'** 1. Add product specific Registry Keys.
'**
'** Each and every thing you do for configuartion needs very
'** careful thought.
'**
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** programgroup$: The name of the program group where the user chose to
'** install the program manager icons
'**
'** Errors: No return code for errors, you must Raise them
'** Author: PMD
'**
'*************************************************************************
PUBLIC SUB AddRegistryKeysLWP (prodno%, network$)
DIM LocPath$, Filename$, descript$, gbuf$, instvalue&
DIM szkey$, szkey2$, nsize&, nsize1&, nsize2&, nsize3, Insttype$, szval$
DIM rc&, keyvalue$, keyvalue1$,keyvalue2$, keyvalue3$, keyvalue4$
DIM Dll$, Key$, DataPath$, Location&, notused%, Path$
DIM HelpFile$
DIM UserName$, CompName$, Initials$, tempkey$
'DebugMsg1 "entering addregistrykeyslwp"
szkey$ = gREGLOTUS + "WordPro\97.0"
descript$ = LdString(SID_LWP_SHORT_NAME)
keyvalue$ = "Path"
keyvalue1$ = "Description"
keyvalue2$ = "Name"
Insttype$ = "InstallType"
Filename$ = "wordpro.exe"
nsize1 = len(Filename) + 1
nsize2 = len(descript$) + 1
UserName$ = GetSymbolValue(SYM_NAME$)
CompName$ = GetSymbolValue(SYM_COMPANY$)
Initials$ = STRING$(40, 0)
rc& = GetInitials(username$, initials$)
If network$ = gNODE$ Then
instvalue = 1
ElseIf network$ = gSTANDARD$ Then
instvalue = 0
End if
nsize3 = 4
rc& = ERROR_SUCCESS
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
locpath$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", Filename$)
locpath = Lot_TrimEndSlash (locpath$)
nsize = len(LocPath$) + 1
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szkey)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, keyvalue$, REG_SZ, LocPath$, nsize)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, keyvalue2$, REG_SZ, Filename, nsize1)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, keyvalue1$, REG_SZ, descript$, nsize2)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, Insttype$, REG_DWORD, instvalue, nsize3)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, "UserName", REG_SZ, UserName$, len(UserName$) + 1)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, "CompanyName", REG_SZ, CompName$, len(CompName$) + 1)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey, "UserInitials", REG_SZ, Initials$, len(Initials$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+szkey,"",""
END IF
END IF
'** Write the registry value to add the new language
AddRegistryLanguage LdString(SID_LWP_PROD_NAME), _
LdString(SID_LWP_PROD_VER)
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
DIM ExePath$
ExePath$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", Filename$)
notused% = Lot_RegAppPath(LdString(SID_LWP_LWPEXE), ExePath$, _
"", FALSE, "LWP_BASICS")
END IF
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
szkey$ = "CLSID\{2913FFFE-2EED-1069-BF5D-00DD011186B7}\InProcServer32"
rc& = Lot_RegCreateKeyEx(HKEY_CLASSES_ROOT, szkey)
rc& = Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, szkey$, _
"ThreadingModel", REG_SZ, "Apartment", len("Apartment") + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+szkey,"",""
END IF
' Note for international: The filename shellnew.lwp does not
' need to be translated. This isn't exposed in the UI.
'
DIM shellnew$
szkey$ = ".lwp\ShellNew"
shellnew$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "shellnew.lwp")
IF shellnew$ <> "" THEN
shellnew$ = shellnew$ + "shellnew.lwp"
rc& = Lot_RegCreateKeyEx(HKEY_CLASSES_ROOT, szkey)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_CLASSES_ROOT, szkey$, _
"FileName", REG_SZ, shellnew$, len(shellnew$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+szkey,"",""
END IF
END IF
END IF
' I need to do these registry entries for the language tools because
' CIT doesn't support Thesaurus, Grammar, and Hyphenation
'
IF Lot_IsTheFeatureInstalled("LWPHYPHENATIONPRG") <> FALSE THEN
Key$ = "SOFTWARE\Lotus\Wordpro\97.0\Hyphenation\4.0"
DataPath$ = LWP_WhereIsFeature(prodno%, _
"LWPHYPHENATIONDATA", LdString(SID_LWP_LOTUSXX2_HYP))
DataPath$ = Lot_TrimEndSlash(DataPath$)
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, _
"Data Path", REG_SZ, DataPath$, len(DataPath$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
END IF
END IF
IF Lot_IsTheFeatureInstalled("LWPGRAMMARPRG") <> FALSE THEN
Key$ = "SOFTWARE\Lotus\Wordpro\97.0\GrammarChecker\3.0"
DataPath$ = LWP_WhereIsFeature(prodno%, _
"LWPGRAMMARDATA", LdString(SID_LWP_LOTUSXX2_GCS))
DataPath$ = Lot_TrimEndSlash(DataPath$)
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, _
"Data Path", REG_SZ, DataPath$, len(DataPath$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
END IF
END IF
' Register any help or related files
' Note: These files are removed from winhelp.ini like the ones below.
'
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP0N71XX_HLP)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP0N71XX_CNT)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP1N71XX_HLP)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP1N71XX_CNT)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP3N71XX_HLP)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP3N71XX_CNT)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP4N71XX_HLP)
LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP4N71XX_CNT)
'
'*** Don't register this. wp5n71xx gets renamed as wp0n71xx.
' LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP5N71XX_HLP)
' LWP_RegisterHelpFile prodno%, "LWP_HELPFILE", LdString(SID_LWP_WP5N71XX_CNT)
'
' Cleanup winhelp.ini
'
' Note for international: These filenames do not need to be
' translated so I did not resource them. This is only here
' to cleanup beta sites which only got these English files.
' We must remove them from winhelp.ini so the info there does
' not conflict with what should be in the registry. Again,
' this is only for beta sites.
'
DIM WinHelpIni$
WinHelpIni$ = GetWindowsDir() + "winhelp.ini"
RemoveIniKey WinHelpIni$, "Files", "lthlpn30.dll", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lc1n21en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lc1n21en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lc2n21en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lc2n21en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "ltschrt2.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lsen31en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lsen31en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lsln31en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "lsln31en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "tm1n10en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "tm1n10en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "ltsmail3.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "mb1c10en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "mb1c10en.cnt", cmoNone
RemoveIniKey WinHelpIni$, "Files", "as1n10en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "as1n11en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "cs1n10en.hlp", cmoNone
RemoveIniKey WinHelpIni$, "Files", "fl2c10en.hlp", cmoNone
LWP_RegShrComponent "WIN32SHRQUICKDEMOPRG", "Animations", "1.1"
LWP_RegShrComponent "WIN32SHRASWANPRG", "Aswan", "1.4"
LWP_RegShrComponent "WIN32SHRBENTOPRG", "Bento", "3.0"
LWP_RegShrComponent "WIN32SHRBUBBHELPPRG", "Bubble Help", "1.2"
LWP_RegShrComponent "WIN32SHRCCSTRPRG", "ccStr", "1.0"
LWP_RegShrComponent "WIN32SHRCHARTPRG", "Chart", "2.1"
LWP_RegShrComponent "WIN32SHRCUSTSUPPHELPPRG", "CustomerSupportHelp", "4.0"
LWP_RegShrComponent "WIN32SHRDIALOGDLLPRG", "Dialog DLL", "3.0"
LWP_RegShrComponent "WIN32SHRSHAREDHELPPRG", "Help", "3.1"
LWP_RegShrComponent "WIN32SHRSMARTICONPRG", "Icon Palette", "7.1"
LWP_RegShrComponent "WIN32SHRLISDBPRG", "LISDB", "1.0"
LWP_RegShrComponent "WIN32SHRLOTUSSCRIPTPRG", "LotusScript", "3.1"
LWP_RegShrComponent "WIN32SHRSTDPLAYERPRG", "Player", "1.1"
LWP_RegShrComponent "WIN32SHRSPELLPRG", "Spell", "4.0"
'' ** Thesaurus Data File only!!!
LWP_RegShrComponent "LWPTHESAURUSPRG", "Thesaurus", "3.0"
LWP_RegShrComponent "WIN32SHRSTATUSBARPRG", "Status Bar", "6.1"
LWP_RegShrComponent "WIN32TEAMMAILSHRPRG", "TeamMail", "1.1"
LWP_RegShrComponent "WIN32SHRUIMSPRG", "Infobox", "2.1"
LWP_RegShrComponent "WIN32SHRUINST", "Uninstall", "1.0"
LWP_RegShrComponent "WIN32SHRNOTESOPENSAVEPRG", "NotesOpenSave", "1.0"
LWP_RegShrComponent "WIN32SHRINTERNETPRG", "Internet", "1.0"
LWP_RegShrComponent "WIN32SHRFILLSDATA", "Fills", "1.0"
LWP_RegShrComponent "WIN32SHRIMPORTFILTERCDR", "GraphicFilters", "1.1"
LWP_RegShrComponent "WIN32SHRIMPORTFILTERINICDR", "GraphicFilters", "1.1"
LWP_RegShrComponent "WIN32SHRIMPORTFILTERPCD" , "GraphicFilters", "1.1"
LWP_RegShrComponent "WIN32SHRIMPORTFILTERINIPCD", "GraphicFilters", "1.1"
'-------------------------------------
'** User Dictionary for Spell 5/23/96
'
IF Lot_IsTheFeatureInstalled("WIN32SHRSPELLPRG") <> FALSE THEN
Key$ = "SOFTWARE\Lotus\Components\Spell\4.0"
DataPath$ = "ltsuser1.udc"
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
"UserDictionaryFiles", REG_SZ, DataPath$, len(DataPath$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
END IF
END IF
'-------------------------------------
'** QuickStart
'
IF Lot_IsTheFeatureInstalled("LWP_QUICKSTART") <> FALSE THEN
Filename$ = LdString(SID_LWP_QUICKSTART_DLL)
Key$ = "SOFTWARE\Lotus\Components\Startup\97.0\Word Pro"
DataPath$ = LWP_WhereIsFeature(prodno%, "LWP_QUICKSTART", Filename$) _
+ Filename$
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, _
"DLL", REG_SZ, DataPath$, len(DataPath$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
ELSE
'** Register for Uninstall
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_LOCAL_MACHINE\Software\Lotus\Components\Startup")
END IF
END IF
'-------------------------------------
'** AltComponents
'
' szkey$ = gREGLOTUS + "WordPro\97.0"
' szval$ = "\AltComponents"
' rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szkey$)
' rc& = RegDeleteValueA(HKEY_LOCAL_MACHINE, szkey$ + szval$)
'print "Alt comp key = " + szkey$ + " rc& = " rc&
'-------------------------------------
' The remaining used to be in RegisterLWP
'
IF Lot_IsTheFeatureInstalled("LWP_BASICS") = FALSE THEN EXIT SUB
DIM rv%, ExecError%
DIM ServerDir$, NodeDir$, WordProReg$, FullPath$
WordProReg$ = "wordpro.reg"
ServerDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "wordpro.exe")
NodeDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", WordProReg$)
'--------------------------------------
'** Write the OLE registration database
'
' Process the wordpro.reg file, substituting the user chosen product
' directory for our dummy string (in our case: \app\exe\win32).
' Then run regedit on the newly-formed wordpro.reg.
'
' !!!! MAKE SURE .LYT FILE SAYS WE ALWAYS OVERWRITE WORDPRO.REG !!!!
'
FullPath$ = LWPLFN2SFN(NodeDir$ + WordProReg)
notused% = FixAppPath(FullPath$, ServerDir$)
LWP_RegeditFile NodeDir$, WordProReg$
' IF DoesFileExist(WordProReg$, femExists) THEN
' rc& = Lot_Regedit(NodeDir$, "wordpro.reg")
' ' rc& = WinExec("regedit /s " + WordProReg$, SW_HIDE)
' END IF
LWP_RegeditFile ServerDir$, "ltscorrt.reg"
LWP_RegeditFile ServerDir$, "ltsfills.reg"
LWP_RegeditFile ServerDir$, "lwp.reg"
LWP_RegeditFile ServerDir$, "lwp4wp.reg" '''
LWP_RegeditFile ServerDir$, "lwp4wpex.reg"
LWP_RegeditFile ServerDir$, "lwpdca.reg" '''
LWP_RegeditFile ServerDir$, "lwpdcaft.reg"
LWP_RegeditFile ServerDir$, "lwpdcaps.reg"
LWP_RegeditFile ServerDir$, "lwphtml.reg" '''
LWP_RegeditFile ServerDir$, "lwpimage.reg" '''
LWP_RegeditFile ServerDir$, "lwplabel.reg"
LWP_RegeditFile ServerDir$, "lwptools.reg" '''
LWP_RegeditFile ServerDir$, "lwptls.reg"
LWP_RegeditFile ServerDir$, "lwpuser.reg" '''
'-----------------------------
' Set Internet Proxies
'
If GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ Then
If LWP_IsChapterIn("WIN32SHRINTERNETPRG") Then
notused% = SetInternetProxies()
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CURRENT_USER\Software\Lotus\Components\Internet\1.0\WWW Proxies")
End if
End if
'-----------------------------
' Possibly Disable Background Spell Check
'
CheckLangForBackgroundSpell
'-----------------------------
' Fixup Special Paths
'
LWP_FixupTourPath network$, prodno%
LWP_FixupGraphicsPath network$, prodno%
LWP_FixupBackgroundsPath network$ ''Must do after FixupGraphicsPath
'-----------------------------
' Register User Paths
'
LWP_WriteUserPaths network$
'-----------------------------
' Update appropriate Ini files (** includes InstalledPaths key **)
'
WriteLotusIni network$, prodno%
WriteLWPIni network$, prodno%
WriteLWPUserIni network$, prodno%
' -------------
' These keys should probably go away. Duplicates registered under 97.0 above
'
' Keep them since they're under HCU as opposed to HLM
'
tempkey$ = gREGLOTUS +"WordPro\97.0\lwpuser.ini\WordProUser"
rc& = ERROR_SUCCESS
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, tempkey, "UserName", REG_SZ, UserName$, len(UserName$) + 1)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, tempkey, "CompanyName", REG_SZ, CompName$, len(CompName$) + 1)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, tempkey, "UserInitials", REG_SZ, Initials$, len(Initials$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, " oops "+"\"+szkey,"",""
END IF
'-----------------
'LWP_FinishSavePrevUserSettings
'---------------------------------
' ** Let uninstall know about all the changes to the registry
'
'
' ** Uninstall should take care of the Product Key ** sdb 5/16/96
' ** But there is some question about how this works in a suite setting
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CURRENT_USER\Software\Lotus\WordPro\97.0")
'** Uninstall SmartCorrect: We're the only ones who use this ShrdComp
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CURRENT_USER\Software\Lotus\Components\SmartCorrect\2.0")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\AmiProDocument")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\CLSID\{0003002F-0000-0000-C000-000000000046}")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\WordPro.Document")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\CLSID\{2913FFFE-2EED-1069-BF5D-00DD011186B7}")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.sam")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.smm")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.lwp")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.mwp")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.sdw")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\.smi")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\CLSID\{29130400-2EED-1069-BF5D-00DD011186B7}")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\CLSID\{29130401-2EED-1069-BF5D-00DD011186B7}")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\CLSID\{29130403-2EED-1069-BF5D-00DD011186B7}")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\wordpro.main")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\Wordpro.Application")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\Wordpro.Application.97")
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_HIVE$, "HKEY_CLASSES_ROOT\Wordpro.SmartMaster")
'DebugMsg1 "leaving addregistrykeyslwp"
END SUB
'*************************************************************************
'** FUNCTION AddIconsLWP (prodno%, network$, direction$, programgroup$) AS STRING
'**
'** Purpose: This is called just after file copy has completed.
'** 1. Add program manager icons of those features
'** that were installed.
'** NOTE: THERE are many subtleties in here if you are
'** dealing with node and CD installs. In particular,
'** you must be ***very*** careful to understand where the
'** things are that you are pointing to. They could
'** be on the node, server, or CD! This, in combination
'** with the INF file for Server/Node, is probably the
'** trickiest part of writing a quality install. When
'** configuring, you must be careful to consider what
'** happens if there is a pre-existing product on the
'** machine, in the same location or
'** another one! This is very very tricky. What happens
'** if you had a full installation previously in location C:\FOO
'** and now the user is installing a minimum installation in loaction
'** D:\FOO.
'**
'** Each and every thing you do for configuartion needs very
'** careful thought.
'**
'** WE support a function Lot_WhereIsFeature("FeatureID")
'** This currrently tells you the location of a feature
'** if the feature appears both in the SERVER.INF and the
'** NODE.INF referred to by the same Keyword ID.
'** We do not support CDs with this command yet, but we will
'** at some time.
'**
'** Also look out for writing to a file when the directory
'** doesn't exist. If the user deselected one of your
'** options, your install may still be running, but since
'** there were no files to copy into the directory
'** it wasn't created by the toolkit!
'**
'** Finally, remember that configuration files generally
'** hold the state that the user has customized earlier.
'** Sometimes you don't want to overwrite these!
'** You will primarily use three MS-SETUP functions
'** in here:
'** 1. CreateProgmanItem (writing to progman)
'**
'** CreateProgmanGroup & ShowProgmanGroup are
'** done for you by the time you reach this
'** function.
'**
'** You will not have to do any configuration of LOTUS SHARED
'** tools. The toolkit will do this for you.
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'** programgroup$: The name of the program group where the user chose to
'** install the program manager icons
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MZ
'** Returns: return: gNEXT
'**
'*************************************************************************
PUBLIC FUNCTION AddIconsLWP (prodno%, network$, direction$, programgroup$) AS STRING
DIM ripath$, Path$, qsName$, exename$, szArgument$, rc%
DIM LanguageQualifier$, LanguageAcronym$
DIM Link$, Target$, Key$, Value$
AddIconsLWP = direction$
'' In the backwards case, keep backing up
If direction$ = gBACK Then
EXIT FUNCTION
End If
LanguageQualifier$ = ""
LanguageAcronym$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
szArgument$ = "/L" + LanguageAcronym$
'** If language install, add qualifier
IF GetListItem(SYM_INSTALLKINDS$, prodno%) = gLANGUAGEINSTALL$ THEN
LanguageQualifier$ = "-" + LanguageAcronym$
END IF
'--------------------------------------------
' Remove the Shell Icon Cache file, per Keith
'
DIM ShellIconCache$
ShellIconCache$ = GetWindowsDir() + "shelli~1."
IF DoesFileExist(ShellIconCache$, femExists) THEN
RemoveFile ShellIconCache$, cmoForce
END IF
''------------------------------------------------------------------
'' Note: Register Shortcuts for Uninstall using Lot_GetProgFolder(1)
'' so that it works for standalone or suite uninstall
''
IF network$ = gSTANDARD OR network$ = gNODE THEN
IF Lot_IsTheFeatureInstalled("LWP_BASICS") <> FALSE THEN
exename$ = LdString(SID_LWP_LWPEXE)
Path$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", exename$)
IF IsNewShell() THEN
Link$ = LdString(SID_LWP_SHORT_NAME) + _
LanguageQualifier + ".lnk"
rc% = Lot_AddLinkToFolder(prodno%, Path$ + exename$, _
Link$, "", szArgument$, Path$)
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_SHORTCUT$, Lot_GetProgFolder(1) + Link$)
''
'' Note: Register Shortcuts using Lot_GetProgFolder(1)
'' so that it works for standalone or suite uninstall
''
ELSE
Link$ = LdString(SID_LWP_SHORT_NAME) + LanguageQualifier
CreateProgmanItem programgroup$, Link$, _
LWPLFN2SFN(Path$ + exename$) + " " + szArgument$, _
"", cmoOverwrite
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_ICON$, programgroup$ + "\" + Link$)
END IF
END IF
IF Lot_IsTheFeatureInstalled("LWPDLGPRG") <> FALSE THEN
Path$ = LWP_WhereIsFeature(prodno%, "LWPDLGPRG", "lwpdlged.exe")
IF IsNewShell() THEN
Link$ = LdString(SID_LWP_LOTUS_ACCESSORIES) + _
"\" + LdString(SID_LWP_LOTUS_DIALOG_EDITOR) + _
LanguageQualifier + ".lnk"
rc% = Lot_AddLinkToFolder(prodno%, Path$ + "lwpdlged.exe", _
Link$, "", szArgument$, Path$)
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_SHORTCUT$, Lot_GetProgFolder(1) + Link$)
ELSE
Link$ = LdString(SID_LWP_LOTUS_DIALOG_EDITOR) + _
LanguageQualifier
CreateProgmanItem programgroup$, Link$, _
LWPLFN2SFN(Path$ + "lwpdlged.exe") + " " + szArgument$, _
"", cmoOverwrite
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_ICON$, programgroup$ + "\" + Link$)
END IF
END IF
IF Lot_IsTheFeatureInstalled("LWP_DISK1READMES") <> FALSE THEN
Path$ = LWP_WhereIsFeature(prodno%, "LWP_DISK1READMES", _
LdString(SID_LWP_README_TXT))
IF IsNewShell() THEN
Link$ = LdString(SID_LWP_LOTUS_USER_ASSISTANCE) + "\" + _
LdString(SID_LWP_WORD_PRO_PRODUCT_UPDATES) + _
LanguageQualifier + ".lnk"
rc% = Lot_AddLinkToFolder(prodno%, Path$ + _
LdString(SID_LWP_README_TXT), Link$, "", "", Path$)
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_SHORTCUT$, Lot_GetProgFolder(1) + Link$)
ELSE
Link$ = LdString(SID_LWP_WORD_PRO_PRODUCT_UPDATES) + _
LanguageQualifier
CreateProgmanItem programgroup$, Link$, _
LWPLFN2SFN(Path$ + LdString(SID_LWP_README_TXT)), _
"", cmoOverwrite
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_ICON$, programgroup$ + "\" + Link$)
END IF
END IF
'---------------------------
'** QuickStart App
'
IF Lot_IsTheFeatureInstalled("LWP_QUICKSTART") <> FALSE THEN
qsName$ = LdString(SID_LWP_QUICKSTART_EXE)
Path$ = LWP_WhereIsFeature(prodno%, "LWP_QUICKSTART", qsName$)
IF IsNewShell() THEN
Key$ = "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
Value$ = "Startup"
Target$ = STRING$(256, 0)
IF Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, Key$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
Value$, REG_SZ, Target$, 256)
END IF
Link$ = Left(Target$, Instr(Target$, Chr$(0)) - 1) + "\" _
+ LdString(SID_LWP_QUICKSTART_DESC) + ".lnk"
Path$ = Path$ + qsName$
rc% = CreateLink(Path$, Link$, "", "", "")
rc% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_SHORTCUT$, Link$)
''
'' ELSE if not IsNewShell() ??????
''
END IF
END IF
END IF
SKIPCONFIG:
END FUNCTION
'*************************************************************************
'** FUNCTION PostSuccessRegLWP (prodno%, network$, direction$) AS STRING
'**
'** Purpose: If you need to launch something after install runs
'** In Symbols :
'** Out Symbols:
'**
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT
'**
'** Errors: No return code for errors, you must Raise them
'** Author: MMeth
'** Returns: return: gNEXT
'**
'*************************************************************************
PUBLIC FUNCTION PostSuccessRegLWP (prodno%, network$, direction$) AS STRING
DIM Path$, qsName$, rc%
PostSuccessRegLWP = direction$
'' In the backwards case, keep backing up
If direction$ = gBACK Then
EXIT FUNCTION
End If
END FUNCTION
PUBLIC FUNCTION InitLanguageLWP (prodno%, network$, direction$) AS STRING
'*************************************************************************
'** Purpose: Finds out the installed languages and determines the nature
'** of the install. If not running automated, displays a message box for
'** a language install
'**
'** Author: JMDonohue
'** Arguments: All parameters are **read only**.
'** prodno%: This is your prodno%. It is assigned to you by the
'** toolkit in the order in which you were registered.
'** When your product is part of SmartSuite, SmartSuite
'** will always be product #1. (prodno% >=1)
'** network$: gSTANDARD | gSERVER | gNODE | gDISTRIBTUION
'** direction$: gNEXT | gBACK (If gBACK, and you are showing UI)
'** then step backwards
'**
'** Returns: (not used)
'**
'** Implicitly sets the following global symbols for later processing:
'** SYM_INSTALLKIND$
'** SYM_INSTALLKINDS$ (list)
'** Sets the following global symbols (based on product #1) for later
'** processing:
'** SYM_REG_PRODUCTNAME$
'** SYM_REG_PRODUCTVER$
'*************************************************************************
DIM szProductName$, szProductVersion$, szInstallKind$, szLanguageSubdir$
szProductName$ = LdString(SID_LWP_PROD_NAME)
szProductVersion$ = LdString(SID_LWP_PROD_VER)
if prodno% = 1 THEN
SetSymbolValue SYM_REG_PRODUCTNAME$ , szProductName$
SetSymbolValue SYM_REG_PRODUCTVER$ , szProductVersion$
END IF
InitLanguages szProductName$, szProductVersion$, prodno%
LWPProductNumber% = prodno%
InitLanguageLWP = ""
END FUNCTION
'********************************
'********************************
'** Product Specific Functions **
'********************************
'********************************
'*************************************************************************
'** SUB LWP_RegisterOCXs(prodno%)
'**
'** Purpose: Register OCX's and Typelib
'** Author: SDB
'** Date: 8/1/96
'*************************************************************************
SUB LWP_RegisterOCXs(prodno%)
DIM CLSID$, locpath$, ocxpath$
'' Script Stuff
locpath$ = Lot_WhereIsFeature(prodno%, "LWPMSVC40", "mfc40.dll")
ocxpath$ = locpath$ + "mfc40.dll"
Lot_RegisterOCX(ocxpath$)
locpath$ = Lot_WhereIsFeature(prodno%, "LWPMSVC40", "olepro32.dll")
ocxpath$ = locpath$ + "olepro32.dll"
Lot_RegisterOCX(ocxpath$)
locpath$ = Lot_WhereIsFeature(prodno%, "WIN32SHRLOTUSSCRIPTPRG", "lcsrtn10.dll")
ocxpath$ = locpath$ + "lcsrtn10.dll"
Lot_RegisterOCX(ocxpath$)
locpath$ = Lot_WhereIsFeature(prodno%, "WIN32SHRLOTUSSCRIPTPRG", "ltsctn31.ocx")
ocxpath$ = locpath$ + "ltsctn31.ocx"
Lot_RegisterOCX(ocxpath$)
''** HTML
locpath$ = Lot_WhereIsFeature(prodno%, "LWP_HTML_OCX", "lwphtml.ocx")
ocxpath$ = locpath$ + "lwphtml.ocx"
Lot_RegisterOCX(ocxpath$)
LWP_RegUninstallHTML
'--------------------------
' Type Library Registration
'
DIM Version$, TLDir$, TypeLib$, flags%
If Lot_IsTheFeatureInstalled("LWP_SCRIPT_TYPELIB") _
OR LWP_IsChapterIn("LWP_SCRIPT_TYPELIB") _
Then
CLSID$ = "{291307FF-2EED-1069-BF5D-00DD011186B7}"
Version$ = "1.0"
TypeLib$ = "lwplsntl.tlb"
flags% = LIBFLAG_FRESTRICTED '' = 1
TLDir$ = Lot_WhereIsFeature(prodno%, "LWP_SCRIPT_TYPELIB", TypeLib$)
New_RegisterTypeLib TLDir$ + TypeLib$, TLDir$
'** New CIT version above. SDB 11/15/96
'** Lot_RegisterTypeLib CLSID$, Version$, "Lotus Word Pro 97 Object Model", TLDir$, TLDir$ + TypeLib$, flags%
'
Lot_RegisterObject "LWP_BASICS", UNIN_CLASS_REGISTRY_HIVE$, _
"HKEY_CLASSES_ROOT\TypeLib\" + CLSID$
' We don't register this CLSID entry, so no need to Uninstall
'Lot_RegisterObject "LWP_BASICS", UNIN_CLASS_REGISTRY_HIVE$, _
' "HKEY_CLASSES_ROOT\CLSID\" + CLSID$
End if
END SUB
'*************************************************************************
'** SUB LWP_RegUninstallHTML()
'**
'** Purpose: Register LWPHTML stuff for uninstall
'** Author: SDB
'** Date: 9/1/96
'*************************************************************************
SUB LWP_RegUninstallHTML()
LWP_RegCLSID "{530B32E3-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32E4-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32E7-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32E8-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32EB-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32EC-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32EF-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32F0-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32F3-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32F4-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32F7-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32F8-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32FB-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32FC-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B32FF-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B3300-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B3303-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegCLSID "{530B3304-81AA-11CF-BCAA-0020AF24D443}"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.chkCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.comCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.edtCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.lstCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.mrkCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.radCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.resCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.subCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\" + "LWPHTML.txtCtrl.1"
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\TypeLib\" + _
"{530B32E0-81AA-11CF-BCAA-0020AF24D443}"
END SUB
'*************************************************************************
'**
SUB LWP_RegCLSID (clsid$)
LWP_RegBasicUninstReg "HKEY_CLASSES_ROOT\CLSID\" + clsid$
END SUB
'*************************************************************************
'**
SUB LWP_RegBasicUninstReg (key$)
Lot_RegisterObject "LWP_BASICS", UNIN_CLASS_REGISTRY_HIVE$, key$
END SUB
'*************************************************************************
'** SUB LWP_FixupTourPath(network$, prodno%)
'**
'** Purpose: Special handling for Tour directory to read off CD or Server.
'** We only leave it alone if we install the tour to a standalone.
'** Node installs never get the tour.
'**
'** Author: SDB
'*************************************************************************
SUB LWP_FixupTourPath(network$, prodno%)
' If Node or if Tour not installed
' Then set it to the Server tour directory (x:\lotus\wordpro\tour)
' Else set it to LWPDIR + Tour
'
'
' ExeDir will be the server in a node install.
'
DIM ExeDir$
If network = gNODE$ _
Then
ExeDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "wordpro.exe")
SetSymbolValue "LWPTOURDIR", ExeDir$ _
+ LdString(SID_LWP_TOUR_DIR)
Elseif LWP_IsChapterIn("LWP_TOUR") = 0 _
Then
'
' SYM_INSTALL_SOURCE for Suite = x:...\lotus
' SuiteNode= x:...\lotus
' StdAlone = x:...\lotus
' StdA Node= x:...\lotus\wordpro
'
SetSymbolValue "LWPTOURDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_DIR) _
+ LdString(SID_LWP_TOUR_DIR)
Else
SetSymbolValue "LWPTOURDIR", GetSymbolValue("LWPDIR") _
+ LdString(SID_LWP_TOUR_DIR)
End if
'''OLD CODE pre-1/10/97
%rem
'
' SYM_INSTALL_SOURCE for Suite = x:...\lotus
' SuiteNode= x:...\lotus
' StdAlone = x:...\lotus
' StdA Node= x:...\lotus\wordpro
'
' Note: In the SuiteNode case, we assume that the server
' has installed wordpro in the wordpro directory!!
' This works for 97 because the user can't change
' the folders.
'
SetSymbolValue "LWPTOURDIR", GetSymbolValue("LWPDIR") _
+ LdString(SID_LWP_TOUR_DIR)
If network = gNODE$ _
Then
If GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ _
Then
SetSymbolValue "LWPTOURDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_TOUR_DIR)
Else
SetSymbolValue "LWPTOURDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_DIR) _
+ LdString(SID_LWP_TOUR_DIR)
End if
Elseif LWP_IsChapterIn("LWP_TOUR") = 0 _
Then
SetSymbolValue "LWPTOURDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_DIR) _
+ LdString(SID_LWP_TOUR_DIR)
End if
%endrem
END SUB
'*************************************************************************
'** SUB LWP_FixupGraphicsPath(network$, prodno%)
'**
'** Purpose: Special handling for Graphics directories.
'**
'** Author: SDB
'*************************************************************************
SUB LWP_FixupGraphicsPath(network$, prodno%)
' If Node
' Then set it to the Server tour directory (x:\lotus\wordpro\tour)
'
'
' ExeDir will be the server in a node install.
'
DIM ExeDir$
If network = gNODE$ _
Then
ExeDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "wordpro.exe")
SetSymbolValue "LWPGRAPHICSDIR", ExeDir$ _
+ LdString(SID_LWP_GRAPHICS_DIR)
End if
%rem
'
' SYM_INSTALL_SOURCE for Suite = x:...\lotus
' SuiteNode= x:...\lotus
' StdAlone = x:...\lotus
' StdA Node= x:...\lotus\wordpro
'
' Note: In the SuiteNode case, we assume that the server
' has installed wordpro in the wordpro directory!!
' This works for 97 because the user can't change
' the folders.
'
If network = gNODE$ _
Then
If GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ _
Then
SetSymbolValue "LWPGRAPHICSDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_GRAPHICS_DIR)
Else
SetSymbolValue "LWPGRAPHICSDIR", GetSymbolValue(SYM_INSTALL_SOURCE) _
+ LdString(SID_LWP_DIR) _
+ LdString(SID_LWP_GRAPHICS_DIR)
End if
End if
%endrem
END SUB
'*************************************************************************
'** SUB LWP_FixupBackgroundsPath(network$)
'**
'** Purpose: Special handling for Graphics and Backgrounds directories.
'**
'** Author: SDB
'*************************************************************************
SUB LWP_FixupBackgroundsPath(network$)
SetSymbolValue "LWPBACKGROUNDSDIR", GetSymbolValue("LWPGRAPHICSDIR") _
+ LdString(SID_LWP_BACKGROUNDS_DIR)
END SUB
'*************************************************************************
'** SUB LWP_WriteUserPaths(network$)
'**
'** Purpose: Write the configuration entries in lwpuser.ini
'** Adjust some paths for MLC installs
'** Author: SDB
'*************************************************************************
SUB LWP_WriteUserPaths(network$)
IF network$ = gSERVER or network$ = gDISTRIBUTION THEN
EXIT SUB
END IF
'DebugMsg1 "Entering LWP_WriteUserPaths"
'DebugDirs
DIM szkey$, rc&
DIM driveletter$, drivetype%
DIM scriptsdir$, mastersdir$, workdir$, iconsdir$, tourdir$
DIM backupdir$, graphicsdir$, backgroundsdir$, glossarydir$
DIM langsubdir$
'' Fixup MLC paths
If GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) = gLANGUAGEINSTALL$ _
Then
langsubdir$ = lcase(GetSymbolValue(SYM_LANGUAGE_SUBDIR$)) + "\"
Else
langsubdir$ = ""
End if
workdir$ = GetSymbolValue("LWPWORKDIR")
backupdir$ = GetSymbolValue("LWPBACKUPDIR")
scriptsdir$ = GetSymbolValue("LWPSCRIPTSDIR")
mastersdir$ = GetSymbolValue("LWPMASTERSDIR") + langsubdir$
iconsdir$ = GetSymbolValue("LWPICONDIR") + langsubdir$
graphicsdir$ = GetSymbolValue("LWPGRAPHICSDIR") + langsubdir$
backgroundsdir$ = GetSymbolValue("LWPBACKGROUNDSDIR") + langsubdir$
glossarydir$ = GetSymbolValue("LWPDIR")
tourdir$ = GetSymbolValue("LWPTOURDIR")
IF network$ = gNODE THEN
IF LWP_IsChapterIn("LWP_SMARTMASTERS") = 0 THEN
mastersdir$ = mastersdir$ + ";" + _
Lot_GetDestDirValueFromInstallIni("LWPMASTERSDIR")
END IF
IF LWP_IsChapterIn("LWP_SAMPLEDOCS") = 0 THEN
workdir$ = workdir$ + ";" + _
Lot_GetDestDirValueFromInstallIni("LWPWORKDIR")
END IF
' Some scripts are always kept on the server
scriptsdir$ = scriptsdir$ + ";" + _
Lot_GetDestDirValueFromInstallIni("LWPSCRIPTSDIR")
' Might have a shared glossary on the server
glossarydir$ = glossarydir$ + ";" + _
Lot_GetDestDirValueFromInstallIni("LWPDIR")
END IF
'-------------------------
' Register Paths 6/27/96
'
szkey$ = gREGLOTUS + "WordPro\97.0\Paths"
rc& = Lot_RegCreateKeyEx(HKEY_CURRENT_USER, szkey)
LWP_AddRegPathKey "Work", workdir$
LWP_AddRegPathKey "Backup", backupdir$
LWP_AddRegPathKey "Scripts", scriptsdir$
LWP_AddRegPathKey "SMasters", mastersdir$
LWP_AddRegPathKey "SmartIcons", iconsdir$
LWP_AddRegPathKey "Graphics", graphicsdir$
LWP_AddRegPathKey "Backgrounds", backgroundsdir$
LWP_AddRegPathKey "GlossaryPath", glossarydir$
LWP_AddRegPathKey "Tour", tourdir$
'DebugDirs
'DebugMsg1 "Leaving LWP_WriteUserPaths"
END SUB
'*************************************************************************
'** Author: SDB
'*************************************************************************
SUB LWP_AddRegPathKey(key$, path$)
DIM rc&, szkey$, Lang$
szkey$ = gREGLOTUS + "WordPro\97.0\Paths\" + key$
Lang$ = GetSymbolValue(SYM_INSTALL_LANGUAGE$)
rc& = Lot_RegCreateKeyEx(HKEY_CURRENT_USER, szkey$)
rc& = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, szkey$, _
Lang$, REG_SZ, path$, len(path$) + 1)
END SUB
'*************************************************************************
'** SUB WriteLotusIni(network$, prodno%)
'**
'** Purpose: Write the configuration entries in lotus.ini
'** Author: TLB
'*************************************************************************
SUB WriteLotusIni(network$, prodno%)
IF network$ = gSERVER or network$ = gDISTRIBUTION THEN
EXIT SUB
END IF
DIM ProgDir$
ProgDir$ = LWP_WhereIsFeature(prodno%, "LWP_BASICS", "wordpro.exe")
DIM LotusIni$
LotusIni$ = GetWindowsDir() + "lotus.ini"
DIM WordProExe$
WordProExe$ = ProgDir$ + "wordpro.exe"
CreateIniKeyValue LotusIni$, "Lotus Applications", "WordPro",_
WordProExe$, cmoOverwrite
CreateIniKeyValue LotusIni$, "Lotus Applications", "AmiPro",_
WordProExe$, cmoOverwrite
END SUB
'*************************************************************************
'** SUB WriteLWPIni(network$, prodno%)
'**
'** Purpose: Write the configuration entries in lwp.ini
'** Author: TLB
'*************************************************************************
SUB WriteLWPIni(network$, prodno%)
IF network$ = gNODE or network$ = gDISTRIBUTION THEN
EXIT SUB
END IF
DIM serialnum$, szkey$, rc&
'Write the Serial Number
serialnum$ = GetSymbolValue(SYM_SERIALNUM$)
szkey$ = gREGLOTUS + "WordPro\97.0\lwp.ini\WordPro"
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, szkey$)
rc& = Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, szkey$, _
"SerialNumber", REG_SZ, serialnum$, len(serialnum$) + 1)
END SUB
'*************************************************************************
'** SUB WriteLWPUserIni(network$, prodno%)
'**
'** Purpose: Write the configuration entries in lwpuser.ini
'** Author: TLB
'*************************************************************************
SUB WriteLWPUserIni(network$, prodno%)
IF network$ = gSERVER or network$ = gDISTRIBUTION THEN
EXIT SUB
END IF
DIM rc&, szkey$, AppOptNum$
szkey$ = gREGLOTUS + "WordPro\97.0\lwpuser.ini\"
'-----------------------------------------------------------
' If user indicated to disable OLE, override default setting
' Also Disables Background spell, DDE, (others?)
'
IF LWPDisableOLE% THEN
AppOptNum$ = "637"
rc& = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, szkey$ + "WordProUser", _
"AppOptions", REG_SZ, AppOptNum$, len(AppOptNum$) + 1)
END IF
'-----------------------------------------------------------
' Write out initial installed locations so we can default to
' them in the future.
'
IF GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) <> gLANGUAGEINSTALL$ _
THEN
LWP_AddInstalledPathKey("LWPDIR")
LWP_AddInstalledPathKey("LWPWORKDIR")
LWP_AddInstalledPathKey("LWPMASTERSDIR")
LWP_AddInstalledPathKey("LWPSAMPLESDIR")
LWP_AddInstalledPathKey("LWPBACKUPDIR")
LWP_AddInstalledPathKey("LWPSCRIPTSDIR")
LWP_AddInstalledPathKey("LWPICONDIR")
LWP_AddInstalledPathKey("LWPTOURDIR")
LWP_AddInstalledPathKey("LWPGRAPHICSDIR")
LWP_AddInstalledPathKey("LWPBACKGROUNDSDIR")
END IF
'---------------------------------------
'Add the most recently used SmartMasters
'
AddMRUSmartMaster prodno%, "LWPSMARTMASTERSALWAYS", _
LdString(SID_LWP_DEFAULT_MWP)
AddMRUSmartMaster prodno%, "MASTERSLETTERS", _
LdString(SID_LWP_LETTER1_MWP)
AddMRUSmartMaster prodno%, "MASTERSLETTERS", _
LdString(SID_LWP_LETTER2_MWP)
AddMRUSmartMaster prodno%, "MASTERSMEMOS", _
LdString(SID_LWP_MEMO1_MWP)
AddMRUSmartMaster prodno%, "MASTERSMEMOS", _
LdString(SID_LWP_MEMO2_MWP)
AddMRUSmartMaster prodno%, "MASTERSFAXES", _
LdString(SID_LWP_FAX1_MWP)
AddMRUSmartMaster prodno%, "MASTERSFAXES", _
LdString(SID_LWP_FAX2_MWP)
AddMRUSmartMaster prodno%, "MASTERSLETTERS", _
LdString(SID_LWP_PERLETTR_MWP)
AddMRUSmartMaster prodno%, "MASTERSNEWS", _
LdString(SID_LWP_NEWS1_MWP)
AddMRUSmartMaster prodno%, "MASTERSCALENDARS", _
LdString(SID_LWP_MONTHCAL_MWP)
END SUB
'*************************************************************************
'** Author: SDB
'*************************************************************************
SUB LWP_AddInstalledPathKey(dirsym$)
DIM path$, rc&
path$ = GetSymbolValue(dirsym$)
rc& = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, _
gREGLOTUS + "WordPro\97.0\lwpuser.ini\InstalledPaths", _
dirsym$, REG_SZ, path$, len(path$) + 1)
END SUB
'*************************************************************************
SUB AddMRUSmartMaster(prodno%, Section$, File$)
'** Purpose: Adds a SmartMaster to the MRU list in LWPUSER.ini
'** Author: TLB
'*************************************************************************
STATIC LastIndex%
DIM rc&, MasterPath$, szkey$
szkey$ = gREGLOTUS + "WordPro\97.0\lwpuser.ini\WordProUser"
LastIndex% = LastIndex% + 1
IF Lot_IsTheFeatureInstalled(Section$) <> FALSE THEN
MasterPath$ = LWP_WhereIsFeature(prodno%, Section$, File$)
IF MasterPath$ <> "" THEN
MasterPath$ = MasterPath$ + File$
rc& = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, _
szkey$, "LastSmartMaster" + LTrim$(Str$(LastIndex%)), _
REG_SZ, MasterPath$, len(MasterPath$) + 1)
END IF
END IF
END SUB
'*************************************************************************
'** FUNCTION GetInstalledLWPVersion(network$)
'**
'** Purpose: Determines if a version of LWP is already installed
'** Author: TLB
'** Arguments:
'** Returns: STRING indicating which version was found
'*************************************************************************
FUNCTION GetInstalledLWPVersion(network$) AS STRING
DIM pos%, BinType%, LotusIni$, Executable$, Version$
Version$ = ""
LotusIni$ = GetWindowsDir() + "lotus.ini"
Executable$ = GetIniKeyString(LotusIni$, "Lotus Applications", "AmiPro")
pos% = INSTR(Executable$, " ")
IF pos% <> 0 THEN
Executable$ = MID$(Executable$, 1, pos% - 1)
END IF
IF DoesFileExist(Executable$, femExists) THEN
pos% = INSTR(UCASE$(Executable$), "AMIPRO.EXE")
IF pos% <> 0 THEN
Version$ = "AMIPRO"
ELSE
pos% = INSTR(UCASE$(Executable$), "WORDPRO.EXE")
IF pos% <> 0 THEN
BinType% = GetBinType(Executable$)
IF BinType% = 1 THEN
Version$ = "WORDPRO16"
ELSEIF BinType% = 2 THEN
Version$ = "WORDPRO32"
END IF
END IF
END IF
END IF
GetInstalledLWPVersion = Version$
END FUNCTION
'*************************************************************************
'** FUNCTION GetPreviousMastersDir()
'**
'** Purpose: Determines existing path to SmartMasters or Styles
'** Author: TLB
'** Arguments:
'** Returns: The directory as a string
'*************************************************************************
FUNCTION GetPreviousMastersDir() AS STRING
DIM PrevMasters$, LWPUserIni$, AmiproIni$, idx%
SELECT CASE InstalledLWPVersion$
CASE "WORDPRO32"
PrevMasters$ = GetDefaultPath("MASTERS", "")
CASE "WORDPRO16"
LWPUserIni$ = GetWindowsDir() + "lwpuser.ini"
PrevMasters$ = GetIniKeyString(LWPUserIni$, "WordProUser", _
"StylePath")
CASE "AMIPRO"
AmiproIni$ = GetWindowsDir() + "amipro.ini"
PrevMasters$ = GetIniKeyString(AmiproIni$, "Amipro", "StyPath")
CASE ELSE
PrevMasters$ = ""
END SELECT
' Only take first path if more than one
'
idx% = INSTR(PrevMasters$, ";")
IF idx% <> 0 THEN
PrevMasters$ = LEFT$(PrevMasters$, idx% - 1)
END IF
GetPreviousMastersDir = Lot_TrimEndSlash(PrevMasters$)
END FUNCTION
'*************************************************************************
'** FUNCTION GetPreviousWorkDir()
'**
'** Purpose: Determines existing path to Work
'** Author: TLB
'** Arguments:
'** Returns: The directory as a string
'*************************************************************************
FUNCTION GetPreviousWorkDir() AS STRING
DIM PrevWorkDir$, LWPUserIni$, AmiproIni$, idx%
SELECT CASE InstalledLWPVersion$
CASE "WORDPRO32"
PrevWorkDir$ = GetDefaultPath("WORK", "")
CASE "WORDPRO16"
LWPUserIni$ = GetWindowsDir() + "lwpuser.ini"
PrevWorkDir$ = GetIniKeyString(LWPUserIni$, "WordProUser", _
"DocPath")
CASE "AMIPRO"
AmiproIni$ = GetWindowsDir() + "amipro.ini"
PrevWorkDir$ = GetIniKeyString(AmiproIni$, "Amipro", "DocPath")
CASE ELSE
PrevWorkDir$ = ""
END SELECT
' Only take first path if more than one
'
idx% = INSTR(PrevWorkDir$, ";")
IF idx% <> 0 THEN
PrevWorkDir$ = LEFT$(PrevWorkDir$, idx% - 1)
END IF
GetPreviousWorkDir = Lot_TrimEndSlash(PrevWorkDir$)
END FUNCTION
'*************************************************************************
'** FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
'**
'** Purpose: Lot_WhereIsFeature fails if the feature to find is not
'** being copied in this particular session. In a reinstallation
'** situation, this is bad since some features will already be
'** installed and we'd like to know where, even if we aren't installing
'** them this time around. This function give CIT a chance, and if
'** it fails then it tries to find the location itself.
'** Author: TLB
'** Arguments: As in Lot_WhereIsFeature
'** Returns: The directory path
'*************************************************************************
FUNCTION LWP_WhereIsFeature(prodno%, featureId$, filetolookfor$) AS STRING
DIM WhereIs$, chpt$, DestDir$, DestDirSym$
WhereIs$ = Lot_WhereIsFeature(prodno%, featureId$, filetolookfor$)
IF WhereIs$ = "" THEN
chpt$ = Lot_GetChapterFromKeyWord(featureId$)
DestDirSym$ = Lot_GetChapterValStr(chpt$, F_DESTDIRSYM)
DestDir$ = Lot_GetDestDirValueFromInstallIni(DestDirSym$)
IF DoesFileExist(DestDir$ + filetolookfor$, femExists) THEN
WhereIs$ = DestDir$
END IF
END IF
LWP_WhereIsFeature = WhereIs$
END FUNCTION
'*************************************************************************
'** FUNCTION GetDefaultPath(DirName$, basedir$)
'**
'** Purpose: Checks the registry for an existing directory
'** Author: TLB
'** Arguments: Which directory, as in the select below
'** Returns: The directory path from the registry
'*************************************************************************
FUNCTION GetDefaultPath(DirName$, basedir$) AS STRING
DIM Path$, ProdDir$, PrevPath$, LWPDir$
'------------------------------------------------------------------
' Establish default based on Win '95 directory structure guidelines
'
LWPDir$ = LdString(SID_LWP_DIR)
ProdDir$ = basedir$ + LWPDir$
SELECT CASE DirName$
CASE "WORDPRO"
Path$ = ProdDir$
CASE "WORK"
Path$ = basedir$ + LdString(SID_LWP_WORK_DIR) + LWPDir$
CASE "MASTERS"
Path$ = basedir$ + LdString(SID_LWP_MASTERS_DIR) + LWPDir$
CASE "SAMPLES"
Path$ = basedir$ + LdString(SID_LWP_SAMPLES_DIR) + LWPDir$
CASE "BACKUP"
Path$ = basedir$ + LdString(SID_LWP_BACKUP_DIR) + LWPDir$
CASE "SCRIPTS"
Path$ = ProdDir$ + LdString(SID_LWP_SCRIPTS_DIR)
CASE "ICONS"
Path$ = ProdDir$ + LdString(SID_LWP_ICON_DIR)
CASE "TOUR"
Path$ = ProdDir$ + LdString(SID_LWP_TOUR_DIR)
CASE "GRAPHICS"
Path$ = ProdDir$ + LdString(SID_LWP_GRAPHICS_DIR)
' CASE "BACKGROUNDS"
' Path$ = ProdDir$ + LdString(SID_LWP_GRAPHICS_DIR) + LdString(SID_LWP_BACKGROUNDS_DIR)
END SELECT
'----------------------------------------------------------------
' Override default if previous 97 or 96 installation of same type
'
IF InstalledLWPVersion$ = "WORDPRO32" THEN
DIM Key$, Key96$, Key97$, VerNum$
DIM Value$, Value2$, rc%, buff$
buff$ = STRING$(256, 0)
Key96$ = "96.0"
Key97$ = "97.0"
VerNum$ = ""
If LWP_IsSameInstallType(Key97$) Then
VerNum$ = Key97$
Elseif LWP_IsSameInstallType(Key96$) Then
VerNum$ = Key96$
End if
'**
'** SDB 1/8/97 Added check for MLC for Work and Backup Dirs
'**
IF VerNum$ <> "" THEN
SELECT CASE DirName$
CASE "WORDPRO"
Value = "LWPDIR"
Value2 = "LWPDIR"
CASE "WORK"
If GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) _
<> gLANGUAGEINSTALL$ Then
Value = "LWPWORKDIR"
Value2 = "LWPWORKDIR"
End If
CASE "BACKUP"
If GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) _
<> gLANGUAGEINSTALL$ Then
Value = "LWPBACKUPDIR"
Value2 = "LWPBACKUPDIR"
End If
CASE "SCRIPTS"
Value = "LWPSCRIPTSDIR"
Value2 = "LWPSCRIPTSDIR"
CASE "MASTERS"
Value = "LWPMASTERSDIR"
Value2 = "LWPMASTERSLANGDIR"
CASE "SAMPLES"
Value = "LWPSAMPLESDIR"
Value2 = "LWPSAMPLESLANGDIR"
CASE "ICONS"
Value = "LWPICONDIR"
Value2 = "LWPICONLANGDIR"
'' CASE "TOUR"
'' Value = "LWPTOURDIR"
'' Value2 = "LWPTOURLANGDIR"
CASE "GRAPHICS"
Value = "LWPGRAPHICSDIR"
Value2 = "LWPGRAPHICSLANGDIR"
'' Special treatment for 96 graphics
'' since old name is under LWPDRAWSYMDIR
'' Default to 96LwpDir + Graphics
'' and exit
If VerNum$ = Key96$ Then
GetDefaultPath = GetDefaultPath("WORDPRO", basedir$) _
+ LdString(SID_LWP_GRAPHICS_DIR)
EXIT FUNCTION
End if
' CASE "BACKGROUNDS"
' Value = "LWPBACKGROUNDSDIR"
' Value2 = "LWPBACKGROUNDSLANGDIR"
END SELECT
Key$ = "Software\Lotus\WordPro\" + VerNum$ _
+ "\lwpuser.ini\InstalledPaths"
IF Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, Key$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
Value$, REG_SZ, buff$, 256)
'
'** SDB 8/22/96 Value2$ Stuff:
'**
'** The beta-2 release of 97 wrote langdirs out, so do this check
'** in Gold 97 to catch those. After Gold 97, this code can be yanked.
'
IF rc% <> ERROR_SUCCESS THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, Key$, _
Value2$, REG_SZ, buff$, 256)
END IF
'**
'**
'
PrevPath$ = buff$
IF PrevPath$ <> "" AND Lot_CheckPath(PrevPath$) THEN
Path$ = PrevPath$
END IF
END IF
END IF
END IF
GetDefaultPath = Path$
END FUNCTION
'*************************************************************************
'** SUB LWP_IsSameInstallType(VerNum$)
'**
'** Purpose: Registers a help file with Windows. Souped up version of Lot_RegisterHelpFile
'** Author: TLB
'** Arguments:
'*************************************************************************
FUNCTION LWP_IsSameInstallType(VerNum$)
DIM InstallType&, Network$, LWPKey$, Value$, rc%
Network$ = GetSymbolValue(SYM_NETWORK$)
LWPKey$ = "Software\Lotus\WordPro\" + VerNum$ + "\"
Value$ = "InstallType"
IF Lot_DoesRegKeyExistEx(HKEY_LOCAL_MACHINE, LWPKey$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_LOCAL_MACHINE, LWPKey$, _
Value$, REG_DWORD, InstallType&, 4&)
IF rc% = 0 THEN
IF (((InstallType& = 1) AND (Network$ = gNODE$)) OR _
((InstallType& = 0) AND (Network$ = gSTANDARD$))) _
THEN
LWP_IsSameInstallType = TRUE
ELSE
LWP_IsSameInstallType = FALSE
END IF
END IF
END IF
END FUNCTION
'*************************************************************************
'** SUB LWP_RegisterHelpFile
'**
'** Purpose: Registers a help file with Windows. Souped up version of Lot_RegisterHelpFile
'** Author: TLB
'** Arguments:
'*************************************************************************
SUB LWP_RegisterHelpFile(prodno%, Feature$, HelpFile$)
DIM rc&, Key$, Path$, notused%, WinHelpIni$
IF Lot_IsTheFeatureInstalled(Feature$) <> FALSE THEN
Key$ = "SOFTWARE\Microsoft\Windows\Help"
Path$ = LWP_WhereIsFeature(prodno%, Feature$, HelpFile$)
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, _
UCASE$(HelpFile$), REG_SZ, Path$, len(Path$) + 1)
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_REGISTRY_VALUE$, gHLM$ + "\" + Key$ + _
"\" + UCASE$(HelpFile$))
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
END IF
'' Fixes some abstruse upgrade bugs
WinHelpIni$ = GetWindowsDir() + "winhelp.ini"
RemoveIniKey WinHelpIni$, "Files", HelpFile$, cmoNone
END IF
END SUB
'*************************************************************************
'** SUB LWP_RegisterGIDFile
'**
'** Purpose: Registers a gid file. I.e. wp0n71en.hlp => wp0n71en.gid
'** Author: SDB
'** Arguments:
'*************************************************************************
SUB LWP_RegisterGIDFile(ProgDir$, gid$)
gid$ = Left(gid$, Instr(gid$, ".")) + "gid"
notused% = Lot_RegisterObject("LWP_BASICS", _
UNIN_CLASS_FILE$, ProgDir$ + gid$ )
END SUB
'*************************************************************************
'** LWPMOREDIRSCB
'** Purpose: This SUB handles the processing for the MORE DIRECTORIES
'** dialog.
'**
'** IN SYMBOLS handle to dialog, Control ID, Class, Instance
'**
'** Author: Michael Natsis
'** Arguments:
'**
'**
'** Returns:
'**
'*************************************************************************
SUB LWPMOREDIRSCB (hDlg&, CtrlId%, Classes$, LInst&)
DIM dirChanged1%, dirChanged2%, dirChanged3%, i%, notused%
DIM drvSel%,Inst%, dirToChange1$, dirToChange2$,dirToChange3$
STATIC drvIndex%(1 to MAX_NO_DRIVECOMBOS)
'** unc start
DIM uncPath$, fullPath$, dirPath$, drvPath$, n%, hCombo& '** MZ
DIM curCombo$, uncOff&, unusedPath$, NumDirs%
DIM comboBox$, editBox$,dirToChange$
'** unc end
Inst% = CINT(LInst&)
'** unc start
'** Handle all the combo boxes here (if any)
IF INSTR(Classes$, "IDC_COMBO") THEN
i% = VAL(MID$(Classes$, 10, LEN(Classes$) - 9))
comboBox = "IDC_COMBO"+Right$(Str$(i%),1)
editBox = "IDC_EDIT"+Right$(Str$(i%),1)
drvIndex%(i%) = Inst%
curCombo$ = GetListItem(comboBox, Inst%)
fullPath$ = GetListItem("IDC_EDIT",i)
Lot_SplitUNCPath fullPath$, uncPath$, dirPath$
uncOff& = INSTR(1, curCombo$, "\\")
IF uncOff > 0 THEN
Lot_SplitUNCPath MID$(curCombo$, uncOff&), uncPath$, unusedPath$
ELSE
uncPath$ = ""
END IF
SetListItem "IDC_EDIT", i, uncPath$ + dirPath$
AddListItem SYM_UPDATELIST$, editBox
EXIT SUB
END IF
'** unc end
SELECT CASE Classes$
CASE "__DLGINIT"
'** This is the directory for the Work Files
Lot_GetDriveFreeSpaceList "IDC_COMBO1"
SetListItem "IDC_EDIT", 1, GetSymbolValue("LWPWORKDIR")
drvIndex%(1) = ValidateEditBox(hDlg& , 1)
AddListItem SYM_UPDATELIST$, "IDC_EDIT1"
'** This is the directory for the Smart Master Files
Lot_GetDriveFreeSpaceList "IDC_COMBO2"
SetListItem "IDC_EDIT", 2, GetSymbolValue("LWPMASTERSDIR")
drvIndex%(1) = ValidateEditBox(hDlg& , 2)
AddListItem SYM_UPDATELIST$, "IDC_EDIT2"
'** This is the directory for the Backup Files
Lot_GetDriveFreeSpaceList "IDC_COMBO3"
SetListItem "IDC_EDIT", 3, GetSymbolValue("LWPBACKUPDIR")
drvIndex%(1) = ValidateEditBox(hDlg& , 3)
AddListItem SYM_UPDATELIST$, "IDC_EDIT3"
IF GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) = gLANGUAGEINSTALL$ THEN
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_EDIT2), FALSE))
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_EDIT4), FALSE))
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_COMBO2), FALSE))
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_COMBO4), FALSE))
notused% = CINT(ShowWindow (GetDlgItem(hDlg&, IDC_BRWSDIR2), SW_HIDE))
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_BRWSDIR2), FALSE))
notused% = CINT(ShowWindow (GetDlgItem(hDlg&, IDC_BRWSDIR4), SW_HIDE))
notused% = CINT(EnableWindow (GetDlgItem(hDlg&, IDC_BRWSDIR4), FALSE))
End If
CASE "IDC_COMBO"
SELECT CASE Inst%
CASE 1
dirChanged1% = TRUE
CASE 2
dirChanged2% = TRUE
CASE 3
dirChanged3% = TRUE
END SELECT
CASE "IDC_BRWSDIR"
drvSel% = ValidateBrowse(hDlg&,Inst%)
SELECT CASE Inst%
CASE 1
dirChanged1% = TRUE
CASE 2
dirChanged2% = TRUE
CASE 3
dirChanged3% = TRUE
END SELECT
CASE "IDC_EDIT"
SELECT CASE Inst%
CASE 1
dirChanged1% = TRUE
CASE 2
dirChanged2% = TRUE
CASE 3
dirChanged3% = TRUE
END SELECT
CASE "IDC_OK"
'** Validate Paths always: to check for a file with the same name
'** WorkDir
'** unc start 1
drvSel% = ValidateEditBox(hDlg& , 1)
IF drvSel% = 0 THEN
SetListItem "__LASTSTATUS", 1, "Q"
EXIT SUB
ELSE
drvIndex%(1) = drvSel%
END IF
Lot_SplitUNCPath GetListItem("IDC_EDIT",1), uncPath$, dirPath$
IF uncPath$ = "" THEN
drvPath = LEFT$(GetListItem("IDC_COMBO1",drvIndex%(1)), 2)
ELSE
drvPath = ""
END IF
dirToChange1$ = drvPath$ + uncPath + dirPath$
'** unc end
IF ValidatePath(dirToChange1$) = FALSE THEN
SetListItem "__LASTSTATUS",1,"Q"
'SetListItem "_LASTSTATUS",1,"Q"
EXIT SUB
ELSE
SetSymbolValue "LWPWORKDIR", dirToChange1$
END IF
'** SMasters
'** unc start 2
drvSel% = ValidateEditBox(hDlg& , 2)
IF drvSel% = 0 THEN
SetListItem "__LASTSTATUS", 1, "Q"
EXIT SUB
ELSE
drvIndex%(2) = drvSel%
END IF
Lot_SplitUNCPath GetListItem("IDC_EDIT",2), uncPath$, dirPath$
IF uncPath$ = "" THEN
drvPath = LEFT$(GetListItem("IDC_COMBO2",drvIndex%(2)), 2)
ELSE
drvPath = ""
END IF
dirToChange2$ = drvPath$ + uncPath + dirPath$
'** unc end
IF ValidatePath(dirToChange2$) = FALSE THEN
SetListItem "__LASTSTATUS",1,"Q"
'SetListItem "_LASTSTATUS",1,"Q"
EXIT SUB
ELSE
SetSymbolValue "LWPMASTERSDIR", dirToChange2$
END IF
'** Backup
'** unc start 3
drvSel% = ValidateEditBox(hDlg& , 3)
IF drvSel% = 0 THEN
SetListItem "__LASTSTATUS", 1, "Q"
EXIT SUB
ELSE
drvIndex%(3) = drvSel%
END IF
Lot_SplitUNCPath GetListItem("IDC_EDIT",3), uncPath$, dirPath$
IF uncPath$ = "" THEN
drvPath = LEFT$(GetListItem("IDC_COMBO3",drvIndex%(3)), 2)
ELSE
drvPath = ""
END IF
dirToChange3$ = drvPath$ + uncPath + dirPath$
'** unc end
IF ValidatePath(dirToChange3$) = FALSE THEN
SetListItem "__LASTSTATUS",1,"Q"
'SetListItem "_LASTSTATUS",1,"Q"
EXIT SUB
ELSE
SetSymbolValue "LWPBACKUPDIR", dirToChange3$
END IF
'** Refresh destination
Lot_RefreshDestination("LWPWORKDIR")
Lot_RefreshDestination("LWPMASTERSDIR")
Lot_RefreshDestination("LWPBACKUPDIR")
END SELECT 'Classes
END SUB
'*************************************************************************
'** SUB LWPBACKUPMASTERSCB(hDlg&, CtrlId%, Classes$, LInst&)
'**
'** Purpose: Backs up currently installed masters
'**
'** Author: Troy Bartlett
'** Arguments: hDlg%, CtrlId%, Classes$, Inst%
'** Returns: NONE
'*************************************************************************
SUB LWPBACKUPMASTERSCB(hDlg&, CtrlId%, Classes$, LInst&)
SELECT CASE Classes$
CASE "IDC_OK"
LWPBackupSmartMasters% = TRUE
CASE "IDC_CONTINUE"
LWPBackupSmartMasters% = FALSE
CASE "IDC_EXIT"
LWPBackupSmartMasters% = FALSE
END SELECT
END SUB
'*************************************************************************
'** SUB LWPDISABLEOLECB(hDlg&, CtrlId%, Classes$, LInst&)
'**
'** Purpose: Callback for disable OLE dialog
'**
'** Author: Troy Bartlett
'** Arguments: hDlg%, CtrlId%, Classes$, Inst%
'** Returns: NONE
'*************************************************************************
SUB LWPDISABLEOLECB(hDlg&, CtrlId%, Classes$, LInst&)
SELECT CASE Classes$
CASE "IDC_OK"
LWPDisableOLE% = TRUE
CASE "IDC_CONTINUE"
LWPDisableOLE% = FALSE
CASE "IDC_EXIT"
LWPDisableOLE% = FALSE
END SELECT
END SUB
'*************************************************************************
'** SUB LWP_DoBackupSmartMasters()
'**
'** Purpose: Does the work of backing up currently installed masters
'**
'** Author: Troy Bartlett
'** Arguments: NONE
'** Returns: NONE
'*************************************************************************
SUB LWP_DoBackupSmartMasters()
DIM PrevMasters$, NewMasters$, idx%, Master$, OrigMaster$, BackupMaster$
PrevMasters$ = GetPreviousMastersDir()
NewMasters$ = GetSymbolValue("LWPMASTERSDIR") + _
Lot_TrimEndSlash(LdString(SID_LWP_BACKUP_DIR))
IF DoesDirExist(NewMasters$) THEN
FOR idx% = 1 TO 99
IF DoesDirExist(NewMasters$ + LTRIM$(STR$(idx%))) = FALSE THEN
NewMasters$ = NewMasters$ + LTRIM$(STR$(idx%))
EXIT FOR
END IF
NEXT
END IF
IF DoesDirExist(PrevMasters$) AND _
NOT DoesDirExist(NewMasters$) _
THEN
CreateDir NewMasters$, cmoNone
Master$ = DIR$(PrevMasters$ + "\*.*")
WHILE Master$ <> ""
OrigMaster$ = PrevMasters$ + "\" + Master$
BackupMaster$ = NewMasters$ + "\" + Master$
' Per Paul: Just copy, don't remove original
CopyFile OrigMaster$, BackupMaster$, cmoNone, 0
Master$ = DIR$()
WEND
END IF
END SUB
'****************************************************************************
'** SUB LWPRemoveProdFilesCB(hDlg&, CtrlId%, Classes%, Inst&)
'**
'** Purpose: callback to handle Remove Files dialog.
'**
'** Author: BMK 7/18/95 (significantly modified by TLB)
'** Arguments: hDlg%, CtrlId%, Classes$, Inst%
'** Returns: NONE
'****************************************************************************
SUB LWPRemoveProdFilesCB(hDlg&, CtrlId%, Classes$, LInst&)
SELECT CASE Classes$
case "__DLGINIT"
AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT1)
AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT2)
AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
case "IDC_OK"
LWPRemoveProdFiles% = TRUE
case "IDC_BACK"
LWPRemoveProdFiles% = FALSE
case "IDC_EXIT"
LWPRemoveProdFiles% = FALSE
END SELECT
END SUB
'****************************************************************************
'** SUB LWP_RegShrComponent(Feature$, CompKey$, CompVer$)
'**
'** Purpose: Register shared component under the HLM\...\Product\Ver
'**
'** Author: TLB
'** Arguments: Feature name from .SCR and registry keys (name and version)
'** Returns: NONE
'****************************************************************************
SUB LWP_RegShrComponent(Feature$, CompKey$, CompVer$)
DIM Key$, rc&
IF Lot_IsTheFeatureInstalled(Feature$) <> FALSE THEN
Key$ = "SOFTWARE\Lotus\WordPro\97.0\Components\" + _
CompKey$ + "\" + CompVer$
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$ + "\" + Key$,"",""
END IF
END IF
END SUB
'****************************************************************************
'** FUNCTION LWPLFN2SFN(FilePath$)
'**
'** Purpose: Converts the long file name to a short file name.
'**
'** Author: TLB
'** Arguments: The file path to check
'** Returns: The short file name version of the long file name
'****************************************************************************
FUNCTION LWPLFN2SFN(FilePath$) AS STRING
DIM SFN$, bufSize&, rc&
bufSize& = 200
DO
SFN$ = STRING$(bufSize&, " ")
rc& = Win32GetShortPathName(FilePath$, SFN$, bufsize&)
IF rc& = 0 THEN
LWPLFN2SFN = FilePath$
EXIT DO
ELSEIF rc& > bufSize& THEN
bufSize& = rc&
ELSE
LWPLFN2SFN = SFN$
EXIT DO
END IF
LOOP
END FUNCTION
'*************************************************************************
'** SUB LWP_DoFontProcessing
'**
'** Purpose: Adds a font to the system
'** Author: SDB
'** Arguments:
'*************************************************************************
SUB LWP_DoFontProcessing()
DIM sect$
sect$ = "LWPFONTS"
IF Lot_IsTheFeatureInstalled(sect$) <> FALSE THEN
Lot_AddFontByID sect$, "TT0011A_.TTF", SID_LWP_TTF_LOTUSWPINTA
Lot_AddFontByID sect$, "TT0011B_.TTF", SID_LWP_TTF_LOTUSWPINTB
Lot_AddFontByID sect$, "TT0011C_.TTF", SID_LWP_TTF_LOTUSWPBOX
Lot_AddFontByID sect$, "TT0011D_.TTF", SID_LWP_TTF_LOTUSWPTYPE
Lot_AddFontByID sect$, "TT0011E_.TTF", SID_LWP_TTF_LOTUSWPICON
Lot_AddFontByID sect$, "MATHA___.TTF", SID_LWP_EQNTTF_MATHA
Lot_AddFontByID sect$, "MATHB___.TTF", SID_LWP_EQNTTF_MATHB
Lot_AddFontByID sect$, "MATHC___.TTF", SID_LWP_EQNTTF_MATHC
Lot_AddFontByID sect$, "WPPOST1.TTF", SID_LWP_ENVTTF_POST1
END IF
sect$ = "LWP_TRUETYPEFONTS"
IF Lot_IsTheFeatureInstalled(sect$) <> FALSE THEN
Lot_AddFontByID sect$, "ANBI____.TTF", SID_LWP_TTF_ANBI
Lot_AddFontByID sect$, "ANB_____.TTF", SID_LWP_TTF_ANB
Lot_AddFontByID sect$, "ANI_____.TTF", SID_LWP_TTF_ANI
Lot_AddFontByID sect$, "AN______.TTF", SID_LWP_TTF_AN
Lot_AddFontByID sect$, "ARBL____.TTF", SID_LWP_TTF_ARBL
Lot_AddFontByID sect$, "BASBI___.TTF", SID_LWP_TTF_BASBI
Lot_AddFontByID sect$, "BASB____.TTF", SID_LWP_TTF_BASB
Lot_AddFontByID sect$, "BASI____.TTF", SID_LWP_TTF_BASI
Lot_AddFontByID sect$, "BAS_____.TTF", SID_LWP_TTF_BAS
Lot_AddFontByID sect$, "BASBI___.TTF", SID_LWP_TTF_BASBI
Lot_AddFontByID sect$, "BG______.TTF", SID_LWP_TTF_BG
Lot_AddFontByID sect$, "CTRI____.TTF", SID_LWP_TTF_CTRI
Lot_AddFontByID sect$, "CTR_____.TTF", SID_LWP_TTF_CTR
Lot_AddFontByID sect$, "GARBI___.TTF", SID_LWP_TTF_GARBI
Lot_AddFontByID sect$, "GARB____.TTF", SID_LWP_TTF_GARB
Lot_AddFontByID sect$, "GARIT___.TTF", SID_LWP_TTF_GARIT
Lot_AddFontByID sect$, "GAR_____.TTF", SID_LWP_TTF_GAR
Lot_AddFontByID sect$, "GILBI___.TTF", SID_LWP_TTF_GILBI
Lot_AddFontByID sect$, "GILB____.TTF", SID_LWP_TTF_GILB
Lot_AddFontByID sect$, "GILCB___.TTF", SID_LWP_TTF_GILCB
Lot_AddFontByID sect$, "GILC____.TTF", SID_LWP_TTF_GILC
Lot_AddFontByID sect$, "GILI____.TTF", SID_LWP_TTF_GILI
Lot_AddFontByID sect$, "GILU____.TTF", SID_LWP_TTF_GILU
Lot_AddFontByID sect$, "GIL_____.TTF", SID_LWP_TTF_GIL
'' Lot_AddFontByID sect$, "GNBI____.TTF", SID_LWP_TTF_GNBI
'' Lot_AddFontByID sect$, "GNB_____.TTF", SID_LWP_TTF_GNB
'' Lot_AddFontByID sect$, "GNI_____.TTF", SID_LWP_TTF_GNI
'' Lot_AddFontByID sect$, "GN______.TTF", SID_LWP_TTF_GN
Lot_AddFontByID sect$, "IMPACT__.TTF", SID_LWP_TTF_IMPACT
Lot_AddFontByID sect$, "LC______.TTF", SID_LWP_TTF_LC
Lot_AddFontByID sect$, "MTSORTS_.TTF", SID_LWP_TTF_MTSORTS
Lot_AddFontByID sect$, "NGOB____.TTF", SID_LWP_TTF_NGOB
Lot_AddFontByID sect$, "NGOI____.TTF", SID_LWP_TTF_NGOI
Lot_AddFontByID sect$, "NGO_____.TTF", SID_LWP_TTF_NGO
Lot_AddFontByID sect$, "NIMBI___.TTF", SID_LWP_TTF_NIMBI
Lot_AddFontByID sect$, "NIMB____.TTF", SID_LWP_TTF_NIMB
Lot_AddFontByID sect$, "NIMI____.TTF", SID_LWP_TTF_NIMI
Lot_AddFontByID sect$, "ONY_____.TTF", SID_LWP_TTF_ONY
Lot_AddFontByID sect$, "PIB_____.TTF", SID_LWP_TTF_PIB
Lot_AddFontByID sect$, "ROCBI___.TTF", SID_LWP_TTF_ROCBI
Lot_AddFontByID sect$, "ROCB____.TTF", SID_LWP_TTF_ROCB
Lot_AddFontByID sect$, "ROCCB___.TTF", SID_LWP_TTF_ROCCB
Lot_AddFontByID sect$, "ROCLI___.TTF", SID_LWP_TTF_ROCLI
Lot_AddFontByID sect$, "ROCL____.TTF", SID_LWP_TTF_ROCL
END IF
END SUB
'*************************************************************************
'** SUB Used to be AddFont...this is here until CIT provides there version
'**
'** Purpose: Adds a font to the system
'** Author: TLB
'** Arguments:
'*************************************************************************
SUB Lot_AddFontByID (Section$, FontFile$, FontNameID%)
DIM rc&, Key$, FontDir$, FontPath$, notused%, FontName$, WinKey$, prodno%
IF WhatPlatform() = PLATFORM_WIN95 THEN
WinKey$ = "Windows\"
ELSE
WinKey$ = "Windows NT\"
END IF
prodno% = LWPProductNumber%
rc& = ERROR_SUCCESS
IF Lot_IsTheFeatureInstalled(Section$) <> FALSE THEN
FontDir$ = LWP_WhereIsFeature(prodno%, Section$, FontFile$)
IF FontDir$ <> "" THEN
FontPath$ = FontDir$ + FontFile$
FontName$ = LdString(FontNameID%)
Key$ = "SOFTWARE\Microsoft\" + WinKey$ + "CurrentVersion\Fonts"
rc& = Lot_RegCreateKeyEx(HKEY_LOCAL_MACHINE, Key$)
rc& = rc& + Lot_CreateRegKeyValueEx(HKEY_LOCAL_MACHINE, Key$, _
FontName$, REG_SZ, FontPath$, len(FontPath$) + 1)
IF rc& <> ERROR_SUCCESS THEN
RegErrorMsg SID_ERR_REG_GENERIC, gHLM$+"\"+Key$,"",""
END IF
AddFontResource(FontPath$)
END IF
END IF
END SUB
'****************************************************************************
'** SUB LWPRemoveObsoleteFiles(hDlg&, CtrlId%, Classes%, Inst&)
'**
'** Purpose: callback to handle Remove Files dialog.
'**
'** Author: BMK 7/18/95 (significantly modified by TLB, and then jshaw)
'** Arguments: hDlg%, CtrlId%, Classes$, Inst%
'** Returns: NONE
'****************************************************************************
SUB LWPRemoveObsoleteFiles(hDlg&, CtrlId%, Classes$, LInst&)
DIM nSections%, count%, chpt$, sym$, notused%
nSections% = 2
SELECT CASE Classes$
case "__DLGINIT"
AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT1)
AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT2)
AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
case "IDC_OK"
for count% = 1 to nSections%
sym$ = "LWPOBSFILES" + LTRIM$(STR$(count%))
chpt$ = Lot_GetChapterFromKeyWord (sym$)
if chpt$ <> "" then
notused% = Lot_SetChapterFilesInCopyListInOrOut (chpt$, 1)
end if
next
case "IDC_BACK"
' reset INF sections to OFF in case user changes his/her mind
for count% = 1 TO nSections%
sym$ = "LWPOBSFILES" + LTRIM$(STR$(count%))
chpt$ = Lot_GetChapterFromKeyWord(sym$)
if chpt$ <> "" then
notused% = Lot_SetChapterFilesInCopyListInOrOut (chpt$, 0)
end if
next
case "IDC_EXIT"
' reset INF sections to OFF in case user changes his/her mind
for count% = 1 TO nSections%
sym$ = "LWPOBSFILES" + LTRIM$(STR$(count%))
chpt$ = Lot_GetChapterFromKeyWord(sym$)
if chpt$ <> "" then
notused% = Lot_SetChapterFilesInCopyListInOrOut (chpt$, 0)
end if
next
END SELECT
END SUB
'****************************************************************************
'** SUB LWP_RemoveOldShortcuts()
'** Author: SDB
'** Returns: NONE
'****************************************************************************
SUB LWP_RemoveOldShortcuts()
DIM dirname$, fname$
dirname$ = GetWindowsDir() + "\start menu\programs\lotus applications\"
fname$ = dirname$ + "Lotus Word Pro.lnk"
LWP_RemoveFile fname$
fname$ = dirname$ + "Lotus Word Pro Dialog Editor.lnk"
LWP_RemoveFile fname$
fname$ = dirname$ + "Word Pro Read Me.lnk"
LWP_RemoveFile fname$
dirname$ = GetWindowsDir() + "\start menu\programs\smartsuite doconline\"
fname$ = dirname$ + "Exploring Word Pro.lnk"
LWP_RemoveFile fname$
END SUB
'****************************************************************************
'** SUB LWP_RemoveFile(fname$)
'** Author: SDB
'** Returns: NONE
'****************************************************************************
SUB LWP_RemoveFile(fname$)
IF DoesFileExist(fname$, femExists) THEN
RemoveFile fname$, cmoForce
END IF
END SUB
'****************************************************************************
'** SUB LWP_FinishSavePrevUserSettings(oldkey$, newkey$)
'** Author: SDB
'** Returns: NONE
'****************************************************************************
SUB LWP_FinishSavePrevUserSettings()
DIM AppName$, TempVer$, NewVer$, TempKey$, NewKey$
DIM notused%
AppName$ = "WordPro"
TempVer$ = "97.temp"
NewVer$ = "97.0"
TempKey$ = "Software\Lotus\" + AppName$ + "\" + TempVer$
NewKey$ = "Software\Lotus\" + AppName$ + "\" + NewVer$
notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$ + "\lwpuser.ini\InstalledPaths")
notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$ + "\lwpuser.ini\Script Glossary")
'print "1: " notused%
' notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$ + "\lwpuser.ini\WordProUser\BackupPath")
' notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$ + "\lwpuser.ini\WordProUser\DocPath")
' notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$ + "\lwpuser.ini\WordProUser\GraphicPath")
'print "2: " notused%
'LWP_SavePrevUserSettings TempKey$ + "\", NewKey$ + "\", FALSE
notused% = Lot_RegDelAllSubKeys(HKEY_CURRENT_USER, TempKey$)
'print "3: " notused%
END SUB
'****************************************************************************
'** SUB LWP_SavePrevUserSettings(oldkey$, newkey$)
'** Author: SDB
'** Returns: NONE
'****************************************************************************
SUB LWP_SavePrevUserSettings(oldkey$, newkey$, infoboxflag%)
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwp4wp.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpdca.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpeqn.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwphtml.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpimage.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwptools.ini"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpuser.ini\ClickHere"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpuser.ini\SmartIcons"
LWP_DispatchRegCopy "HCU", oldkey$, newkey$, "lwpuser.ini\WordProUser"
If infoboxflag Then
notused% = RegCopy("HCU", oldkey$ + "InfoBox", newkey$ + "lwpuser.ini\InfoBox")
End if
END SUB
'****************************************************************************
'** SUB LWP_DispatchRegCopy
'** Author: SDB
'** Returns: NONE
'****************************************************************************
SUB LWP_DispatchRegCopy(hkey$, oldkey$, newkey$, copy$)
notused% = RegCopy(hkey$, oldkey$ + copy$, newkey$ + copy$)
END SUB
'****************************************************************************
'** SUB LWP_RegeditFile(RegFile$)
'**
'** Purpose: Regedit -s a .reg file
'**
'** Author: SDB
'** Arguments: .reg filename
'** Returns: NONE
'****************************************************************************
SUB LWP_RegeditFile(Path$, RegFile$)
DIM FullPath$, rc%
FullPath$ = LWPLFN2SFN(Path$ + RegFile$)
IF DoesFileExist(FullPath$, femExists) THEN
rc% = Lot_Regedit(Path$, RegFile$)
' rc% = WinExec("regedit /s " + FullPath$, SW_HIDE)
END IF
END SUB
'*************************************************************************
'** LWP_IsChapterIn(chapter$)
'** Author: SDB
'** Returns: 0 or 1 or -1 if chapter not valid?
'*************************************************************************
FUNCTION LWP_IsChapterIn(chapter$)
DIM chptname$
chptname$ = Lot_GetChapterFromKeyword(chapter$)
LWP_IsChapterIn = Lot_GetChapterValInt(chptname$, F_INOROUT)
END FUNCTION
'*************************************************************************
'** LWP_SetChapterInOut(chapter$, inout%)
'**
'** inout% = 0 or 1
'**
'** Author: SDB
'*************************************************************************
FUNCTION LWP_SetChapterInOut(chapter$, inout%)
DIM chptname$, notused%
chptname$ = Lot_GetChapterFromKeyword(chapter$)
notused% = Lot_SetChapterFilesInCopyListInOrOut(chptname$, inout%)
END FUNCTION
'*************************************************************************
'** CheckLangForBackgroundSpell()
'** Author: SDB
'*************************************************************************
SUB CheckLangForBackgroundSpell()
DIM langID, dict$
If GetListItem(SYM_INSTALLKINDS$, LWPProductNumber%) _
<> gLANGUAGEINSTALL$ Then
langID = GetSysDefLangID()
Select CASE GetPrimLangID(langID)
CASE GetLangID_English()
If GetSubLangID(langID) = GetSubLangID_Australian Then
dict$ = "WIN32SHRSPELLDICLANGAU"
Else
dict$ = "WIN32SHRSPELLDICLANGEN"
End if
CASE GetLangID_French()
dict$ = "WIN32SHRSPELLDICLANGFR"
CASE GetLangID_Spanish()
dict$ = "WIN32SHRSPELLDICLANGES"
CASE GetLangID_Portuguese()
dict$ = "WIN32SHRSPELLDICLANGPT"
CASE Else
dict$ = ""
End Select
'print "langID = " langID
'print "Dict = " dict$
'print "LWP_IsChapterIn( " LWP_IsChapterIn(dict$)
'print "Lot_IsTheFeatureInstalled(dict$) = " Lot_IsTheFeatureInstalled(dict$)
'' If (dict$ = "") OR (LWP_IsChapterIn(dict$) <> 1) Then
If Lot_IsTheFeatureInstalled(dict$) = FALSE Then
'print "disabling back spell"
DisableBackgroundSpell
End if
End if
END SUB
'*************************************************************************
'** DisableBackgroundSpell()
'** Author: SDB
'*************************************************************************
SUB DisableBackgroundSpell()
const BackSpellOff = &H80
const AppOptDefault = &H7D
DIM rc%, szkey$, Value$, buff$, AppOptNum$
buff$ = STRING$(256, 0)
szkey$ = gREGLOTUS + "WordPro\97.0\lwpuser.ini\WordProUser"
Value$ = "AppOptions"
AppOptNum$ = CStr(AppOptDefault OR BackSpellOff)
If Lot_DoesRegKeyExistEx(HKEY_CURRENT_USER, szkey$) THEN
rc% = Lot_GetRegKeyValueEx(HKEY_CURRENT_USER, szkey$, _
Value$, REG_SZ, buff$, 256)
If rc% = 0 Then
buff$ = Left(buff$, Instr(buff$, Chr$(0)) - 1)
AppOptNum$ = CStr(CInt(buff$) OR BackSpellOff)
End if
End if
rc% = Lot_CreateRegKeyValueEx(HKEY_CURRENT_USER, szkey$, _
Value$, REG_SZ, AppOptNum$, len(AppOptNum$) + 1)
END SUB
'*************************************************************************
'** DebugMsg1(msg$)
'** Author: SDB
'*************************************************************************
SUB DebugMsg1(msg$)
if gDebugMsg1 then
print msg$
end if
END SUB
'*************************************************************************
'** DebugMsg2(msg$)
'** Author: SDB
'*************************************************************************
SUB DebugMsg2(msg$)
if gDebugMsg2 then
print msg$
end if
END SUB
'*************************************************************************
'** DebugDirs()
'** Author: SDB
'*************************************************************************
SUB DebugDirs()
if gDebugDirs then
print |
LWPDIR |,, GetSymbolValue("LWPDIR") |
LWPLANGDIR |,, GetSymbolValue("LWPLANGDIR") |
LWPICONDIR |,, GetSymbolValue("LWPICONDIR") |
LWPTOURDIR |,, GetSymbolValue("LWPTOURDIR") |
LWPGRAPHICSDIR |,, GetSymbolValue("LWPGRAPHICSDIR") |
LWPBACKGROUNDSDIR |,, GetSymbolValue("LWPBACKGROUNDSDIR") |
LWPMASTERSDIR |,, GetSymbolValue("LWPMASTERSDIR") |
LWPSAMPLESDIR |,, GetSymbolValue("LWPSAMPLESDIR")
end if
END SUB