home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-22 | 45.9 KB | 1,221 lines |
-
- '**************************************************************************
- '* THEME Install
- '**************************************************************************
-
- '' not defined
- ''$DEFINE DEBUG ''Define for script development/debugging
- '$DEFINE CONFIRM
- ''$DEFINE VERSION
- ''$DEFINE REMOVE
- ''$DEFINE MONTHS
- ''$DEFINE CHANGEDATE
- ''$DEFINE INTL
- ''$DEFINE INTL_UK
- ''$DEFINE CONVERSION
- '$DEFINE JOINFILES
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'strings.inc'
- '$INCLUDE 'pbinst.inc'
- '$INCLUDE 'misc.inc'
-
- '$IFDEF CONVERSION
- Declare Function GetPrivateProfileString Lib "Kernel" (lpApplicationName$, lpKeyName$, lpDefault$, lpReturnedString$, nSize%, lpFileName$) As Integer
- Declare Function WritePrivateProfileString Lib "Kernel" (lpApplicationName$, lpKeyName$, lpString$, lplFileName$) As Integer
- '$ENDIF
-
- '$IFDEF JOINFILES
- Declare Function ConcatenateFiles Lib "CONCAT.DLL" (lpFile1$, lpFile2$, lpFileJoined$) As Integer
- '$ENDIF
-
-
-
- CONFIRMTEXTIN$ = "ConfirmTextIn"
- FOR i% = 1 TO 2 STEP 1
- AddListItem CONFIRMTEXTIN$, ""
- NEXT i%
-
-
-
- GLOBAL pStrOptBuf AS POINTER TO STRING *256
- GLOBAL pStrTxtBuf AS POINTER TO STRING *256
-
- GLOBAL bFileSplit%
-
- ''Initialize BadFileList
- BadFileList$ = "BadFileList"
-
- ''________________________________________________________________
- ''
-
- '$IFDEF DEBUG
- ECHO ON ''sends output to debug monitor
- '$ELSE
- ECHO OFF
- '$ENDIF
-
- INIT:
- bFileSplit% = FALSE
-
- CUIDLL$ = CUSTOMDLL ''custom user interface dll
- HELPPROC$ = HELPPROCEDURE ''Help dialog procedure
- SYSDATETIME$ = DATETIME$ ''Get system date and time
-
- SetAbout ABOUTTITLE1, ABOUTTITLE2
- SetBitmap CUIDLL$, LOGO
- SetTitle ABOUTTITLE1
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- ''*** check if ADP is running, err quit if it is
- bIsADPRunning% = FindWindow(CLASSNAME_PBEDB, 0)
- IF bIsADPRunning% THEN
- iRC% = DoMsgBox(ERROR_ADP_RUNNING, ERROR_CAPTION, MB_ICONHAND+MB_TASKMODAL+MB_OK)
- ERR = ERR_FAIL
- GOTO QUIT
- END IF
-
-
- szInstIni$ = GetSymbolValue("STF_CWDDIR") + INSTINI
- '' Debug PRINT szInstIni$
- THEME$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_THEME)
- '' Debug PRINT THEME$
- iNumMonths% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_NUMMONTHS ))
- iNumFiles% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_NUMFILES ))
- bThemeFileType%= VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_IS_SINGLE_FILE))
- bAnimations% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_ANIMATIONS))
- bColor% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_COLORDATA ))
- bThemeFormat% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_QUESTION ))
- bDDOnDay% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_DDONDAY ))
- bWriteComm% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WRITECOMM ))
- bForceWriteDay% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_FORCE_DAY_ZERO ))
- bWriteNumMonths% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WRITE_NUM_MONTHS ))
- cNMTD$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_NMTD )
- bTCODEDDD% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_TCODEDDD ))
- bFindADP% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_FINDADP ))
- SPLASH% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_SPLASH))
- szThemeResID$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_THEME_RES_ID)
- WELCOME_TEXT1$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WEL_TEXT1)
- WELCOME_TEXT1PT2$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WEL_TEXT1PT2)
- WELCOME_TEXT2$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WEL_TEXT2)
- WELCOME_TEXT2PT2$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_WEL_TEXT2PT2)
- szExpireText$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_EXPIRE_TEXT)
- RES_TEXT_XGA$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_RES_TEXT_XGA)
- RES_TEXT_VGA$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_RES_TEXT_VGA)
- RES_TEXT_EGA$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_RES_TEXT_EGA)
- bDDDInData% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_DDDINDATA ))
- bFileSplit% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_FILESPLIT ))
- bNoExpire% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_NOEXPIRE ))
- bMasterInCommon% = VAL(GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_MASTERINCOMMON ))
- iNMTD% = ASC(cNMTD$) - ASC("A") + 1
-
- '' need to artificially touch a file so that it gets current date.
- CreateIniKeyValue szInstIni$, INI_KEY_DATE, INI_KEY_DATE, INI_KEY_DATE, cmoOverwrite
- RemoveIniKey szInstIni$, INI_KEY_DATE, INI_KEY_DATE, 0
- SYSDATETIME$ = GetDateOfFile(szInstIni$)
- '' Debug PRINT SYSDATETIME$
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + INF
- END IF
- '' Debug PRINT "szInf$ = "+szInf$
- ReadInfFile szInf$
-
- WINDRIVE$ = MID$(GetWindowsDir(), 1, 1)
- ini$ = MakePath(GetWindowsDir(), AMAZEINI)
-
- ''*** Check if Amaze.ini is read/writeable. Quit if it is not. If it doesn't exist, don't worry about it
- IF DoesFileExist(ini$, femExists) THEN
- IF DoesFileExist(ini$, femReadWrite) = 0 THEN
- iRC% = DoMsgBox(ini$ + ERROR_INI_NOT_RW, ERROR_CAPTION, MB_ICONHAND+MB_TASKMODAL+MB_OK)
- ERR = -21 '' install failure
- goto QUIT
- END IF
- END IF
- ''*** Setup initial default path
- DEST$ = FindTargetOnEnvVar(FILENAME_PBEDB, ENV_VAR_PATH)
- IF DEST$ <> "" THEN
- SPLITPATH DEST$, szDRV$, szDIR$, szFileName$, szEXT$
- DEST$ = szDRV$ + szDIR$
- ELSE
- IF DoesIniKeyExist(ini$, INI_SEC_INSTALL_INFO, INI_KEY_PROGPATH) THEN
- DEST$ = GetIniKeyString(ini$, INI_SEC_INSTALL_INFO, INI_KEY_PROGPATH)
- IF (DoesFileExist(MakePath(DEST$,FILENAME_PBEDB), femExists)) THEN
- DEST$ = DEST$
- ELSE
- DEST$ = WINDRIVE$ + ":\" + PROGDIR
- END IF
- ELSE
- DEST$ = WINDRIVE$ + ":\" + PROGDIR
- END IF
- ENDIF
- PARTTHEMEDEST$ = GetIniKeyString(szInstIni$, INI_SEC_INFORMATION, INI_KEY_DEFAULTDIR)
- THEMEDEST$ = MakePath(DEST$, PARTTHEMEDEST$)
- iMaxNumTP% = MAX_NUM_THEMES
-
- bThemeExists% = FALSE '' won't allow updating of dll if dll exists
- ''**** Get the Drop Dead Date *************************************
- ''** The next section attempts to get a DDD from the theme pack, if it is not there
- ''** and CONVERSION is defined, it looks to find a special edition theme pack. If
- ''** that isn't there it will create a new DDD by modifying a file and grabbing the date
- ''**
- ''*****
- ''** 7/7/93 - Modified to use DATA file instead of master
- ''**
- IF DoesIniKeyExist(ini$, THEME$, INI_KEY_DATA) THEN
- IF DoesFileExist (GetIniKeyString(ini$, THEME$, INI_KEY_DATA), femReadWrite) THEN
- IF bNoExpire% = TRUE THEN
- bThemeExists% = TRUE
- ELSE
- '' get drop dead date
- DDDate$ = STRING$(32, 32) '' 32 spaces - result buffer
- IF bDDOnDay% = TRUE THEN
- DDDateDay$ = STRING$(32,32)
- END IF
- '' Debug PRINT "DATA = " + GetIniKeyString(ini$, THEME$, INI_KEY_DATA)
- THEMEDLL$ = GetIniKeyString(ini$, THEME$, INI_KEY_DATA)
- '' Debug PRINT THEMEDLL$
- IF bTCODEDDD% = FALSE THEN ''*** read unencoded string if coding not supported
- iRC% = ReadStrResource(THEMEDLL$, IDS_EXPIRATION_COMM, DDDate$, LEN(DDDate$)-1)
- ELSE
- iRC% = ReadStrResource(THEMEDLL$, IDS_EXPIRATION, DDDate$, LEN(DDDate$)-1)
- END IF
- IF bDDOnDay% = TRUE THEN
- iRCD% = ReadStrResource(THEMEDLL$, IDS_EXPIRATIONDAY, DDDateDay$, LEN(DDDateDay$)-1)
- END IF
- IF (iRC% > 0) THEN
- ''PAUSE DDDate$
- DropDeadDate$ = DDDate$
- IF (bTCODEDDD% = TRUE ) THEN
- iRC% = Encrypt(DropDeadDate$) '(de)encrypt DDD
- END IF
- IF bDDOnDay% = TRUE THEN
- DropDeadDateDay$ = DDDateDay$
- END IF
- bThemeExists% = 1
-
- end_y% = VAL(MID$(DropDeadDate$, 1, 4)) ''year of drop dead date
- end_m% = VAL(MID$(DropDeadDate$, 5, 2)) ''month of drop dead date
- IF bDDOnDay% = TRUE THEN
- end_d% = (VAL(MID$(DropDeadDateDay$, 1, 2)) + 1) ''day of start/end
- start_d% = end_d%
- END IF
- start_m% = (end_m%-iNumMonths%+1+12) MOD 12 ''adjust for 1 based month
- IF start_m% = 0 THEN
- start_m% = start_m% + 12
- END IF
- IF (end_m%-iNumMonths%) < 0 THEN
- start_y% = end_y% - 1 ''year of current date
- ELSE
- start_y% = end_y%
- END IF
- END IF
- END IF
- GOTO DoneWithDate
- END IF
- END IF
- '$IFDEF CONVERSION
- IF DoesIniKeyExist(ini$, THEME$+CONVERSION_NAME$, INI_KEY_DATA) THEN
- IF DoesFileExist(GetIniKeyString(ini$, THEME$+CONVERSION_NAME$, INI_KEY_DATA), femReadWrite) THEN
- bConversion% = TRUE
- '' get drop dead date
- DDDate$ = STRING$(32, 32) '' 32 spaces - result buffer
- IF bDDOnDay% = TRUE THEN
- DDDateDay$ = STRING$(32,32)
- END IF
- '' Debug PRINT "DATA = " + GetIniKeyString(ini$, THEME$+CONVERSION_NAME$, INI_KEY_DATA)
- THEMEDLL$ = GetIniKeyString(ini$, THEME$+CONVERSION_NAME$, INI_KEY_DATA)
- '' Debug PRINT THEMEDLL$
- IF bTCODEDDD% = FALSE THEN ''*** read unencoded string if coding not supported
- iRC% = ReadStrResource(THEMEDLL$, IDS_EXPIRATION_COMM, DDDate$, LEN(DDDate$)-1)
- ELSE
- iRC% = ReadStrResource(THEMEDLL$, IDS_EXPIRATION, DDDate$, LEN(DDDate$)-1)
- END IF
- IF bDDOnDay% = TRUE THEN
- iRCD% = ReadStrResource(THEMEDLL$, IDS_EXPIRATIONDAY, DDDateDay$, LEN(DDDateDay$)-1)
- END IF
- IF (iRC% > 0) THEN
- '' Debug PRINT DDDate$
- DropDeadDate$ = DDDate$
- IF (bTCODEDDD% = TRUE ) THEN
- iRC% = Encrypt(DropDeadDate$) '(de)encrypt DDD
- END IF
- IF bDDOnDay% = TRUE THEN
- DropDeadDateDay$ = DDDateDay$
- END IF
- bThemeExists% = TRUE
- IF bWriteNumMonths% = TRUE THEN
- szNumMonths$ = STRING$(32,32)
- iRCD% = ReadStrResource(THEMEDLL$, IDS_THEMEPACK_NUM_MONTHS, szNumMonths$, LEN(szNumMonths$)-1)
- IF (bTCODEDDD% = TRUE ) THEN
- iFRC% = Encrypt(szNumMonths$) ''** decrypt nummonths if necessary
- END IF
- END IF
- ''** compute start date of old SE package
- iOldNumMonths% = VAL(szNumMonths$) ''number of months already installed
- end_y% = VAL(MID$(DropDeadDate$, 1, 4)) ''year of drop dead date
- end_m% = VAL(MID$(DropDeadDate$, 5, 2)) ''month of drop dead date
- IF bDDOnDay% = TRUE THEN
- end_d% = (VAL(MID$(DropDeadDateDay$, 1, 2)) + 1) ''day of start/end
- start_d% = end_d%
- END IF
- start_m% = (end_m%-iOldNumMonths%+1+12) MOD 12 ''adjust for 1 based month
- IF start_m% = 0 THEN '' this fixes a bug in early released themes
- start_m% = start_m% + 12 '' Dec would be recalc'ed as 0 instead of 12
- END IF
-
- IF (end_m%-iOldNumMonths%) < 0 THEN
- start_y% = end_y% - 1 ''year of current date
- ELSE
- start_y% = end_y%
- END IF
- ''** compute new end date for conversion number of months
- end_m% = (start_m%+iNumMonths%-1) MOD 12 ''DDD is zero based month
- IF (start_m%+iNumMonths%) > 12 THEN
- end_y% = start_y% + 1
- ELSE
- end_y% = start_y%
- END IF
-
- END IF
- GOTO DoneWithDate
- END IF
- END IF
- '$ENDIF ''**IFDEF CONVERSION
- ''******If none of the checks above succeeded, this theme is to be
- ''******freshly installed, so we fall throught to this
-
- ''*** for multitheme install, ddd will be that of last theme listed
- start_m% = GetMonthFromDate(SYSDATETIME$) ''month of current date
- start_y% = GetYearFromDate(SYSDATETIME$) ''year of current date
- IF bDDOnDay% = TRUE THEN
- start_d% = GetDayFromDate(SYSDATETIME$) '' day of current date
- end_d% = start_d%
- ELSEIF bForceWriteDay% = TRUE THEN
- start_day% = 1
- end_d% = start_d%
- END IF
- end_m% = (start_m%+iNumMonths%-1) MOD 12 ''DDD is zero based month
- IF (start_m%+iNumMonths%) > 12 THEN
- end_y% = start_y% + 1
- ELSE
- end_y% = start_y%
- END IF
- DoneWithDate: ''**Done getting or creating a date, we can continue now
-
- ''CustInst list symbols
- CHECKSTATES$ = "CheckItemsState"
- STATUSTEXT$ = "StatusItemsText"
- DRIVETEXT$ = "DriveStatusText"
- CONFIRMTEXTIN$ = "ConfirmTextIn"
- FOR i% = 1 TO 2 STEP 1
- AddListItem CONFIRMTEXTIN$, ""
- NEXT i%
- FOR i% = 1 TO 1 STEP 1
- AddListItem CHECKSTATES$, "ON"
- NEXT i%
- FOR i% = 1 TO 2 STEP 1
- AddListItem STATUSTEXT$, ""
- NEXT i%
-
- FOR i% = 1 TO 7 STEP 1
- AddListItem DRIVETEXT$, ""
- NEXT i%
- ReplaceListItem DRIVETEXT$, 7, DEST$
-
-
- ''Disk cost list symbols
- APPNEEDS$ = "AppNeeds"
- THEMENEEDS$ = "ThemeNeeds"
- OTHERNEEDS$ = "OtherNeeds"
- EXTRACOSTS$ = "ExtraCosts"
- BIGLIST$ = "BigList"
- FOR i% = 1 TO 2 STEP 1 ''I think there are only two items on this list
- AddListItem BIGLIST$, ""
- NEXT i%
-
- FOR i% = 1 TO 26 STEP 1
- AddListItem EXTRACOSTS$, "0"
- NEXT i%
-
- ''Default File Option Variables to install all month files
- FOR i% = 0 TO (iNumFiles%-1) STEP 1
- MONTHOPT%(i%) = 1
- NEXT i%
-
- '$IFDEF DEBUG
- i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
- '$ENDIF ''DEBUG
-
- WELCOME:
- szConfirmText$ = WELCOME_TEXT1$ + WELCOME_TEXT1PT2$
- szConfirmText2$ = WELCOME_TEXT2$ + WELCOME_TEXT2PT2$
- DlgCaption$ = "DlgCaption"
- SetSymbolValue DlgCaption$, WELCOME_CAPTION
- ReplaceListItem CONFIRMTEXTIN$, 1, szConfirmText$
- ReplaceListItem CONFIRMTEXTIN$, 2, szConfirmText2$
-
- IF SPLASH% = TRUE THEN
- sz$ = UIStartDlg(CUIDLL$, WELCOMESPLASH, "FSplashDlgProc", WELCOMEHELP, HELPPROC$)
- ELSE
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "FWelcomeDlgProc", WELCOMEHELP, HELPPROC$)
- END IF
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- GOSUB ASKQUIT
- GOTO WELCOME
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO WELCOME
- ELSE
- UIPop 1
- END IF
-
- GETINITIALPATH:
- SetSymbolValue "EditTextIn",THEMEDEST$
- SetSymbolValue "EditFocus", "END"
- GETINITIALPATHL1:
- sz$ = UIStartDlg(CUIDLL$, DESTPATH1, "FEditDlgProc", DESTHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- oldthemedest$ = THEMEDEST$
- THEMEDEST$ = GetSymbolValue("EditTextOut")
- ''Validate new path.
- IF IsDirWritable(THEMEDEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETINITIALPATHL1
- END IF
- UIPop 1
-
- ''Truncate display if too long.
- IF LEN(THEMEDEST$) > 23 THEN
- ReplaceListItem DRIVETEXT$, 7, MID$(THEMEDEST$, 1, 23)+"..."
- ELSE
- ReplaceListItem DRIVETEXT$, 7, THEMEDEST$
- END IF
-
- oldthemedest$ = ""
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETINITIALPATHL1
- ELSEIF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- GOTO GETINITIALPATHL1
- ELSE
- UIPop 1
- END IF
-
-
- CHECK_RES:
-
- szInstallRes$ = GetInstallRes(szThemeResID$)
-
- IF szInstallRes$ = "" THEN
- GOSUB ASKQUIT
- GOTO CHECK_RES
- ELSEIF szInstallRes$ = "0" THEN
- ERR = 21 ''Misc error number - error quit dialog
- GOTO QUIT
- ELSE
- ''PRINT "Install res = " + szInstallRes$
- GOTO CUSTINST
- END IF
-
- CUSTINST:
-
- RecalcPath
-
- MonthButton$ = "MonthButton"
- IF GetListItem(CHECKSTATES$, THEMEPACK) = "ON" THEN
- SetSymbolValue MonthButton$,"ON"
- ELSE
- SetSymbolValue MonthButton$,"OFF"
- END IF
- THEMENAME$ = "THEMENAME"
- IF bAnimations% = TRUE THEN
- SetSymbolValue THEMENAME$, "&" + THEME$ + " " + DLG_TEXT_ANIMATIONS
- ELSE
- SetSymbolValue THEMENAME$, "&" + THEME$
- END IF
-
- sz$ = UIStartDlg(CUIDLL$, CUSTINST_NOOPT, "FCustInstDlgProc", OPTIONSHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
-
- RecalcPath
-
- ''Install only if it will fit.
- IF bHasEnoughDiskSpace% = FALSE THEN
- GOSUB TOOBIG
- GOTO CUSTINST
- END IF
-
- '$IFNDEF CONFIRM
- UIPopALL
- '$ENDIF
- GOTO CONFIRM
- ELSEIF sz$ = "PATH" THEN
- GOTO GETPATH
- ELSEIF sz$ = "REMOVE" THEN
- GOSUB REMOVE_THEME
- GOTO CUSTINST
- ELSEIF sz$ = "CHK1" THEN
- GOTO CUSTINST
- ELSEIF sz$ = "BTN2" THEN
- GOSUB DO_MONTHS
- GOTO CUSTINST
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CUSTINST
- ELSE
- GOSUB ASKQUIT
- GOTO CUSTINST
- END IF
-
- CONFIRM:
- '$IFDEF CONFIRM
-
- IF GetListItem(CHECKSTATES$, THEMEPACK) = "ON" THEN
-
- Cursor% = ShowWaitCursor()
-
- szConfirm1$ = CONFIRM_CHOSE_THEME + THEME$
- PART1:
- ItemNum% = 1
- TotalItems% = 0
- FOR i% = 0 TO (iNumFiles%-1) STEP 1
- IF MONTHOPT%(i%) = 1 THEN
- TotalItems% = TotalItems% + 1
- END IF
- NEXT i%
-
- IF (bNoExpire% = TRUE) THEN
- szConfirm1$ = szConfirm1$ + ". "
- GOTO PART2
- END IF
-
- IF (bThemeFileType% = SINGLEFILE) OR (bThemeFileType% = DATAFILE) OR (bThemeFileType% = DATAONLY)THEN
- '$IFDEF INTL AND NOT INTL_FR
- IF bDDOnDay% = TRUE THEN
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_d%))) + DATE_SEPARATOR + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- ELSE
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- END IF
- '$ELSEIFDEF INTL_FR
- IF bDDOnDay% = TRUE THEN
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_d%))) + DATE_SEPARATOR + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- ELSE
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- END IF
-
- '$ELSE
- IF bDDOnDay% = TRUE THEN
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + PAD(LTRIM$(STR$(start_d%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- ELSE
- szConfirm1$ = szConfirm1$ + CONFIRM_HYPHEN + LTRIM$(STR$(iNumMonths%)) + CONFIRM_1_FILE_THEME_DESC + PAD(LTRIM$(STR$(start_m%))) + DATE_SEPARATOR + LTRIM$(STR$(start_y%))
- END IF
- '$ENDIF
- ELSE
- IF (TotalItems% <> 0) OR (bNoExpire% = TRUE) THEN
- FOR i% = 0 TO (iNumMonths%-1) STEP 1
- CUR_MON_YEAR$ = Month_Year_ToStr((start_m%+i%), (start_y%), " ")
- ''debug
- '' Debug PRINT CUR_MON_YEAR$
- IF MONTHOPT%(i%) = 1 THEN
- IF ItemNum% = 1 THEN ''first
- IF TotalItems% = 1 THEN
- szConfirm1$ = szConfirm1$ + CONFIRM_MULTI_FILE_DESC + CUR_MON_YEAR$
- ELSE
- szConfirm1$ = szConfirm1$ + CONFIRM_MULTI_FILES_DESC + CUR_MON_YEAR$
- END IF
- ELSEIF ItemNum% = TotalItems% THEN ''last
- szConfirm1$ = szConfirm1$ + CONFIRM_PUCTUATION_LAST + CUR_MON_YEAR$
- ELSE ''middle
- szConfirm1$ = szConfirm1$ + CONFIRM_PUCTUATION_MID + CUR_MON_YEAR$
- END IF
- ItemNum% = ItemNum% + 1
- END IF
- NEXT i%
- END IF
- END IF
- IF TotalItems% = 0 THEN
- IF bThemeFormat% = QUESTION THEN
- szConfirm1$ = szConfirm1$ + CONFIRM_NO_QUESTIONS
- ELSE
- szConfirm1$ = szConfirm1$ + CONFIRM_NO_GRAPHICS
- END IF
- ELSE
- SELECT CASE szInstallRes$
- CASE INI_KEY_XGA
- szCurRes$ = RES_TEXT_XGA$
- CASE INI_KEY_VGA
- szCurRes$ = RES_TEXT_VGA$
- CASE INI_KEY_EGA
- szCurRes$ = RES_TEXT_EGA$
- CASE ELSE
- szCurRes$ = RES_DONT_CARE
- END SELECT
- IF szCurRes$ <> "" THEN
- szConfirm1$ = szConfirm1$ + ". " + szCurRes$ + CONFIRM_RESOLUTION
- ELSE
- szConfirm1$ = szConfirm1$ + "."
- END IF
- END IF
- PART2:
- INSTRUCTIONS$ = CONFIRM_INSTRUCT_PART1 + CONFIRM_INSTRUCT_PART2
- CHANGEDATETEXT$ = CONFIRM_CHANGE_DATE
-
- IF (bThemeExists% = FALSE) AND (bNoExpire% = FALSE) THEN
- szConfirm2$ = INSTRUCTIONS$ + CHANGEDATETEXT$
- ELSE
- szConfirm2$ = INSTRUCTIONS$
- END IF
-
- ReplaceListItem CONFIRMTEXTIN$, 1, szConfirm1$
- ReplaceListItem CONFIRMTEXTIN$, 2, szConfirm2$
-
- RestoreCursor Cursor%
- ELSE
- szConfirm1$ = CONFIRM_NO_THEMEPACK
-
- INSTRUCTIONS$ = CONFIRM_INSTRUCT_PART1 + CONFIRM_INSTRUCT_PART2
-
- szConfirm2$ = INSTRUCTIONS$
-
- ReplaceListItem CONFIRMTEXTIN$, 1, szConfirm1$
- ReplaceListItem CONFIRMTEXTIN$, 2, szConfirm2$
- END IF
-
- CONFIRML1:
- sz$ = UIStartDlg(CUIDLL$, CONFIRM, "FConfirmDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPopAll
- GOTO INSTALL
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO CONFIRML1
- ELSE
- UIPop 1
- GOTO CUSTINST
- END IF
- '$ENDIF
-
- INSTALL:
-
- '$IFDEF VERSION
- iR% = VERSION(GetWindowsDir(), szInstIni$, INF_SEC_VERSION)
- '$IFDEF VERSION_FIX
- iC% = ContentVersion(GetWindowsDir(), szInstIni$, INI_SECT_CONTENT_VERSION)
- IF (iC% = 1) THEN ''' TRUE is incompatible content is installed
- iResponse% = MsgYesNo(VERSION_BAD_GENERAL, VERSION_QUIT, VERSION_CAPTION)
- IF iResponse% = NO THEN
- ERR = ERR_FAIL
- GOTO QUIT
- ENDIF
- END IF
- '$ENDIF
- '$ENDIF
-
-
- RecalcPath
-
- IF bHasEnoughDiskSpace% = FALSE THEN
- GOSUB TOOBIG
- GOTO CUSTINST
- END IF
-
- CreateDir THEMEDEST$, cmoNone
-
- RecalcPath
- CopyFilesInCopyList
-
- '''********************************************************************************
-
-
- IF GetListItem(CHECKSTATES$, THEMEPACK) = "ON" THEN
- CursorSave% = ShowWaitCursor()
- IF (bThemeExists% = FALSE) OR (bConversion% = TRUE) THEN
- FOR i% = 1 TO iMaxNumTP% STEP 1
- IF GetIniKeyString(ini$, INI_SEC_THEME_PACKS, INI_KEY_TP+LTRIM$(STR$(i%)) ) <> THEME$ THEN
- IF DoesIniKeyExist(ini$, INI_SEC_THEME_PACKS, INI_KEY_TP+LTRIM$(STR$(i%)) ) = 0 THEN
- CreateIniKeyValue ini$, INI_SEC_THEME_PACKS, INI_KEY_TP+LTRIM$(STR$(i%)), THEME$, cmoOverwrite
- CreateIniKeyValue ini$, INI_SEC_INTERNAL, INI_KEY_DEFAULT_THEME_PACK,LTRIM$(STR$(i%-1)), cmoOverwrite
- EXIT FOR
- END IF
- ELSE
- EXIT FOR
- END IF
- NEXT i%
- ''** 7/7/93 - modified to use a master=amzetoon.dll and data=terd.dll
- IF (bMasterInCommon% = 1) THEN
- CreateIniKeyValue ini$, THEME$, INI_KEY_MASTER, GetSectionKeyFilename(INF_SEC_COMMON, INI_KEY_MASTER), cmoOverwrite
- ELSE
- CreateIniKeyValue ini$, THEME$, INI_KEY_MASTER, MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_MASTER)), cmoOverwrite
- END IF
- CreateIniKeyValue ini$, THEME$, INI_KEY_DATA, MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_DATA)), cmoOverwrite
- END IF
- IF bThemeFileType% = SINGLEFILE THEN
- acIniString$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_MONTHS, INF_KEY_FIRST_FILE + szInstallRes$))
- CreateIniKeyValue ini$, THEME$, INI_KEY_FILE, acIniString$, cmoOverwrite
- ELSE
- IF (bThemeFileType% = DATAFILE) OR (bThemeFileType% = DATAONLY) THEN
- acIniString$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INF_KEY_DATA))
- CreateIniKeyValue ini$, THEME$, INF_KEY_DATA, acIniString$, cmoOverwrite
-
- IF bThemeFileType% = DATAFILE THEN
- FOR i%=0 TO (iNumFiles%-1) STEP 1
- acIniString$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_FILE + LTRIM$(STR$(i%)) ) )
- CreateIniKeyValue ini$, THEME$, INI_KEY_FILE + LTRIM$(STR$(i%)), acIniString$, cmoOverwrite
- IF bFileSplit% = TRUE THEN
- acFile1$ = acIniString$
- acFile2$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_FILE + LTRIM$(STR$(i%)) + LTRIM$(STR$(2)) ) )
- bRet% = ConcatenateFiles(acFile1$, acFile2$, MakePath(THEMEDEST$, JOIN_TEMP))
- IF bRet% <> 1 THEN
- ERR = ERR_FAIL
- GOTO QUIT
- END IF
- RemoveFile acFile1$, cmoNone
- RemoveFile acFile2$, cmoNone
- RenameFile MakePath(THEMEDEST$, JOIN_TEMP), GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_FILE + LTRIM$(STR$(i%)) )
- END IF
- NEXT i%
- ELSEIF (bThemeFileType% = DATAONLY) AND (bFileSplit% = TRUE) THEN
- acFile1$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INF_KEY_DATA) )
- acFile2$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INF_KEY_DATA + LTRIM$(STR$(2)) ) )
- bRet% = ConcatenateFiles(acFile1$, acFile2$, MakePath(THEMEDEST$, JOIN_TEMP))
- IF bRet% <> 1 THEN
- ERR = ERR_FAIL
- GOTO QUIT
- END IF
- RemoveFile acFile1$, cmoNone
- RemoveFile acFile2$, cmoNone
- RenameFile MakePath(THEMEDEST$, JOIN_TEMP), GetSectionKeyFilename(INF_SEC_THEME, INF_KEY_DATA )
- END IF
- ELSE
- FOR i% = 0 TO (iNumMonths%-1) STEP 1
- CUR_MON_YEAR$ = Month_Year_ToStr((start_m%+i%), (start_y%), "")
- IF MONTHOPT%(i%) = 1 THEN
- acIniKey$ = CUR_MON_YEAR$ + szInstallRes$
- acIniString$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_MONTHS, LTRIM$(STR$(((start_m%-1)+i%) MOD iNumMonths%)) + szInstallRes$))
- '' Debug PRINT acIniString$
- CreateIniKeyValue ini$, THEME$, acIniKey$, acIniString$, cmoOverwrite
- END IF
- NEXT i%
- END IF
- IF bColor% = TRUE THEN
- IF szInstallRes$ = INI_KEY_IND THEN
- CreateIniKeyValue ini$, THEME$, INI_KEY_COLORDATA, MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME,INI_KEY_COLORDATA)), cmoOverwrite
- ELSE
- CreateIniKeyValue ini$, THEME$, INI_KEY_COLORDATA + szInstallRes$, MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME,INI_KEY_COLORDATA + szInstallRes$)), cmoOverwrite
- END IF
- END IF
- END IF
-
- '$IFDEF DDD
- IF ((bThemeExists% = FALSE) AND (bNoExpire% = FALSE)) OR (bConversion% = TRUE)THEN
- '' update dropdeaddate
- DropDeadDate$ = LTRIM$(STR$(end_y%))+PAD(LTRIM$(STR$(end_m%)))
- IF (bDDOnDay% = TRUE) OR (bForceWriteDay% = TRUE) THEN
- DropDeadDateDay$ = PAD(LTRIM$(STR$(end_d%-1)))
- END IF
- ''** 7/7/93 modified to use DATA instead of master
- THEMEDLL$ = MakePath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_THEME, INI_KEY_DATA))
- ''PAUSE THEMEDLL$
- CommercialDDD$ = DropDeadDate$
- IF (bTCODEDDD% = TRUE ) THEN
- ''PAUSE "Before tcode: " + DropDeadDate$
- iRC% = Encrypt(DropDeadDate$)
- ''PAUSE "After tcode: " + DropDeadDate$
- END IF
- IF bWriteComm% = TRUE THEN
- iRC% = WriteStrResource (THEMEDLL$, IDS_EXPIRATION, DropDeadDate$)
- END IF
- '*** this will write to normal DDD if not separated
- iRC% = WriteStrResource (THEMEDLL$, IDS_EXPIRATION_COMM, CommercialDDD$)
-
- IF (bWriteNumMonths% = TRUE) THEN
- szNMTD$ = PAD(LTRIM$(STR$(iNMTD%)))
- IF (bTCODEDDD% = TRUE ) THEN
- ''PAUSE "Before Tcode:" + szNMTD$
- iFRC% = Encrypt(szNMTD$)
- ''PAUSE "After Tcode:" + szNMTD$
- END IF
- iRC% = WriteStrResource (THEMEDLL$, IDS_THEMEPACK_NUM_MONTHS, szNMTD$)
- END IF
- IF (bDDOnDay% = TRUE) OR (bForceWriteDay% = TRUE)THEN
- iRCD% = WriteStrResource (THEMEDLL$, IDS_EXPIRATIONDAY, DropDeadDateDay$)
- END IF
- IF (iRC% < 0) THEN
- '' Debug PRINT iRC%
- ERR = ERR_FAIL
- GOTO QUIT
- END IF
- END IF
- '$ENDIF
-
- IF bAnimations% = TRUE THEN
- INIKEYS$ = "IniKeys"
- MakeListFromSectionKeys INIKEYS$, INF_SEC_ANIMATIONS
- IF GetListLength(INIKEYS$) > 0 THEN
- FOR i% = 1 TO GetListLength(INIKEYS$) STEP 1
- szIniKey$ = GetListItem(INIKEYS$, i%)
- szAniFilePath$ = Makepath(THEMEDEST$, GetSectionKeyFilename(INF_SEC_ANIMATIONS, szIniKey$))
- szAniTagV$ = INI_KEY_ANI + INI_KEY_VGA + szIniKey$
- szAniTagE$ = INI_KEY_ANI + INI_KEY_EGA + szIniKey$
- szAniTagX$ = INI_KEY_ANI + INI_KEY_XGA + szIniKey$
- CreateIniKeyValue ini$, THEME$, szAniTagV$, szAniFilePath$, cmoOverwrite
- CreateIniKeyValue ini$, THEME$, szAniTagE$, szAniFilePath$, cmoOverwrite
- CreateIniKeyValue ini$, THEME$, szAniTagX$, szAniFilePath$, cmoOverwrite
- NEXT i%
- END IF
- END IF
- RestoreCursor CursorSave%
- END IF
-
- QUIT:
-
- ON ERROR GOTO ERRQUIT
-
- IF (ERR = 0) AND (bRestart% = TRUE) THEN
- dlg% = EXITRESTART
- ELSEIF ERR = 0 THEN ''no need to restart
- dlg% = EXITSUCCESS
- ELSEIF ERR= STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox(ERROR_INSTALL, ERROR_CAPTION, MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
- ''------------------------------------------------------------------------------
- '' FUNCTIONS
- ''------------------------------------------------------------------------------
-
-
- GETPATH:
- SetSymbolValue "EditTextIn", THEMEDEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", DESTHELP, HELPPROC$)
-
- IF sz$ = "CONTINUE" THEN
- oldthemedest$ = THEMEDEST$
- THEMEDEST$ = GetSymbolValue("EditTextOut")
-
- ''Validate new path.
- IF IsDirWritable(THEMEDEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL1
- END IF
- UIPop 1
-
- ''Truncate display if too long.
- IF LEN(THEMEDEST$) > 23 THEN
- ReplaceListItem DRIVETEXT$, 7, MID$(THEMEDEST$, 1, 23)+"..."
- ELSE
- ReplaceListItem DRIVETEXT$, 7, THEMEDEST$
- END IF
-
- oldthemedest$ = ""
- GOTO CUSTINST
- ELSEIF sz$ = "REACTIVATE" THEN
- RecalcPath
- GOTO GETPATHL1
- ELSEIF sz$ = "EXIT" THEN
- GOSUB ASKQUIT
- GOTO GETPATHL1
- ELSE
- UIPop 1
- GOTO CUSTINST
- END IF
-
-
- DO_MONTHS:
- '$IFDEF MONTHS
- MonthOptions '' calls MonthOptions from MISC.INC
- '$ENDIF
- RETURN
-
- REMOVE_THEME:
- '$IFDEF REMOVE
- RemoveThemeFiles ''included in MISC.INC
- '$ENDIF
- RETURN
-
-
-
- TOOBIG:
- sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- GOTO TOOBIG
- END IF
- UIPop 1
- RETURN
-
-
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- RecalcPath
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
- BADNAME:
- sz$ = UIStartDlg(CUIDLL$, CBBADNAME, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO BADNAME
- END IF
- UIPop 1
- RETURN
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
- '**
- '** Purpose:
- '** Converts int month and year to a formatted string to display
- '** Arguments:
- '** month% - int corresponding to a month, can be greater than 12
- '** eg. 1 -> JAN, 13 -> JAN.
- '** year% - int year. If month% is greater than 12 year will be incremented
- '** Returns:
- '** String - formatted as "MMM YYYY". eg "JAN 1992"
- '*************************************************************************
- FUNCTION Month_Year_ToStr (imonth%, iyear%, szSeparator$) STATIC AS STRING
-
- SELECT CASE imonth% MOD 12
- CASE 1
- MON$ = JAN
- CASE 2
- MON$ = FEB
- CASE 3
- MON$ = MAR
- CASE 4
- MON$ = APR
- CASE 5
- MON$ = MAY
- CASE 6
- MON$ = JUN
- CASE 7
- MON$ = JUL
- CASE 8
- MON$ = AUG
- CASE 9
- MON$ = SEP
- CASE 10
- MON$ = OCTOB
- CASE 11
- MON$ = NOV
- CASE 0
- MON$ = DEC
- CASE ELSE
- MON$ = ""
- END SELECT
- IF imonth% > 12 THEN
- acYEAR$ = LTRIM$(STR$(iyear% + 1)) ''month is in next year
- ELSE
- acYEAR$ = LTRIM$(STR$(iyear%)) ''month is in current year
- END IF
- Month_Year_ToStr = MON$ + szSeparator$ + acYEAR$
-
- END FUNCTION
-
-
-
-
- '**
- '** Purpose:
- '** Adds the specified option files to the copy list.
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** APPFILES, THEMEPACK
- '** Returns:
- '** none.
- '*************************************************************************
- SUB AddOptFilesToCopyList (ftype%) STATIC
- IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- IF ftype% = THEMEPACK THEN
- IF (GetListLength(BadFileList$) = 0) THEN
- AddSectionFilesToCopyList INF_SEC_COMMON, SrcDir$, GetWindowsDir()
- ELSE
- FilesToInstall$ = "FilesToInstall"
- MakeListFromSectionKeys FilesToInstall$, INF_SEC_COMMON
- FOR i%=1 TO GetListLength(FilesToInstall$) STEP 1
- FOR j%=1 TO GetListLength(BadFileList$) STEP 1
- IF GetListItem(BadFileList$, j%) <> GetSectionKeyFilename(INF_SEC_COMMON, GetListItem(FilesToInstall$, i%)) THEN
- AddSectionKeyFileToCopyList INF_SEC_COMMON, GetListItem(FilesToInstall, i%), SrcDir$, GetWindowsDir()
- EXIT FOR
- END IF
- NEXT j%
- NEXT i%
- RemoveSymbol FilesToInstall$
- END IF
- IF (bThemeFileType% = MULTIFILE) THEN
- FOR i% = 0 TO (iNumFiles%-1) STEP 1
- IF MONTHOPT%(i%) = TRUE THEN
- AddSectionKeyFileToCopyList INF_SEC_MONTHS, LTRIM$(STR$(((start_m%-1)+i%) MOD iNumMonths%)) + szInstallRes$, SrcDir$, THEMEDEST$
- END IF
- NEXT i%
- ELSEIF bThemeFileType% = SINGLEFILE THEN
- IF MONTHOPT%(0) = 1 THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INF_KEY_FIRST_FILE + szInstallRes$, SrcDir$, THEMEDEST$
- END IF
- ELSEIF bThemeFileType% = DATAFILE THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INF_KEY_DATA, SrcDir$, THEMEDEST$
- FOR i% = 0 TO (iNumFiles%-1) STEP 1
- IF MONTHOPT%(i%) = TRUE THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_FILE + LTRIM$(STR$(i%)), SrcDir$, THEMEDEST$
- IF bFileSplit% = TRUE THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_FILE + LTRIM$(STR$(i%)) + LTRIM$(STR$(2)), SrcDir$, THEMEDEST$
- END IF
- END IF
- NEXT i%
- ELSEIF bThemeFileType% = DATAONLY THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INF_KEY_DATA, SrcDir$, THEMEDEST$
- IF bFileSplit% = TRUE THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INF_KEY_DATA + LTRIM$(STR$(2)), SrcDir$, THEMEDEST$
- END IF
- END IF
-
- IF bColor% = TRUE THEN
- IF szInstallRes$ = INI_KEY_IND THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_COLORDATA, SrcDir$, THEMEDEST$
- ELSE
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_COLORDATA + szInstallRes$, SrcDir$, THEMEDEST$
- END IF
- END IF
- IF (bThemeExists% = FALSE) OR (bConversion% = TRUE) THEN
- ''** 7/7/93 - added DATA file, and moved master to win dir
- ''** AddSectionKeyFileToCopyList INF_SEC_COMMON, INI_KEY_MASTER, SrcDir$, GetWindowsDir()
- IF bMasterInCommon% <> 1 THEN
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_MASTER, SrcDir$, THEMEDEST$
- END IF
- AddSectionKeyFileToCopyList INF_SEC_THEME, INI_KEY_DATA, SrcDir$, THEMEDEST$
-
- END IF
- IF bAnimations% = TRUE THEN
- AddSectionFilesToCopyList INF_SEC_ANIMATIONS, SrcDir$, THEMEDEST$
- END IF
- END IF
- SrcDir$ = ""
- END IF
-
- END SUB
-
-
- '**
- '** Purpose:
- '** Recalculates disk space for the given option files and sets
- '** the status info symbol "StatusItemsText".
- '** Arguments:
- '** ftype% - type of files to add, one of the following:
- '** APPFILES, THEMEPACK
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcOptFiles (ftype%) STATIC
- DIM iExtraDiskSpace%
- CursorSave% = ShowWaitCursor()
-
- iExtraDiskSpace% = 0
- STILLNEEDSPACE$ = "StillNeedSpace"
-
- AddOptFilesToCopyList ftype%
-
- fExtra% = 0
-
- IF ftype% = THEMEPACK THEN
- ListSym$ = THEMENEEDS$
- END IF
-
- StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, STILLNEEDSPACE$)
-
- cost& = 0
-
- FOR i% = 1 TO 26 STEP 1
- IF VAL(GetListItem(ListSym$, i%)) <> 0 THEN
- ''PRINT "Disk space for " + STR$(i%) + " = " + GetListItem(ListSym$, i%)
- END IF
- cost& = cost& + VAL(GetListItem(ListSym$, i%))
- NEXT i%
- ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
-
- IF fExtra% THEN
- ReplaceListItem EXTRACOSTS$, ndrive%, "0"
- END IF
- RestoreCursor CursorSave%
- ListSym$ = ""
- END SUB
-
-
- '**
- '** Purpose:
- '** Recalculates disk space and sets option status info according
- '** to the current destination path.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB RecalcPath STATIC
-
- CursorSave% = ShowWaitCursor()
- ClearCopyList
- RecalcOptFiles THEMEPACK
- SetDriveStatus
-
- RestoreCursor CursorSave%
- END SUB
-
-
- '**
- '** Purpose:
- '** Sets drive status info according to latest disk space calcs.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB SetDriveStatus STATIC
-
- drive$ = MID$(THEMEDEST$, 1, 1)
- ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
- cost& = VAL(GetListItem(THEMENEEDS$, ndrive%))
- ''cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(THEMENEEDS$, ndrive%))
- free& = GetFreeSpaceForDrive(drive$)
- IF cost& > free& THEN
- bHasEnoughDiskSpace% = FALSE
- ELSE
- bHasEnoughDiskSpace% = TRUE
- END IF
- ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
- ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
-
- IF drive$ = WINDRIVE$ THEN
- ReplaceListItem DRIVETEXT$, 4, ""
- ReplaceListItem DRIVETEXT$, 5, ""
- ReplaceListItem DRIVETEXT$, 6, ""
- ELSE
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- cost& = VAL(GetListItem(THEMENEEDS$, ndrive%))
- ''cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(THEMENEEDS$, ndrive%))
- IF cost& = 0 THEN
- ReplaceListItem DRIVETEXT$, 4, ""
- ReplaceListItem DRIVETEXT$, 5, ""
- ReplaceListItem DRIVETEXT$, 6, ""
- ELSE
- free& = GetFreeSpaceForDrive(WINDRIVE$)
- ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
- ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
- END IF
- END IF
- END SUB
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-
- '**
- '** Purpose:
- '** Pads a string so that it is two bytes. Adds leading zero,
- '**
- '** Arguments:
- '** szNum$ - intended to take a one "digit" string
- '**
- '** Returns:
- '** String padded with a zero
- '*************************************************************************
- FUNCTION PAD (szNum$) STATIC AS STRING
- IF LEN(szNum$) = 1 THEN
- PAD = "0"+szNum$
- ELSE
- PAD = szNum$
- END IF
- END FUNCTION
-
-
- '**
- '** Purpose:
- '** Expands month key to readable string to list in remove listbox
- '**
- '** Arguments:
- '** szMonthKey$ - key from ini file
- '**
- '** Returns:
- '** String formatted to list in listbox
- '*************************************************************************
- FUNCTION ExpandMonthKey (szMonthKey$) STATIC AS STRING
- IF (VAL(MID$(szMonthKey$,4,7))) <> 0 THEN ''if key does not have year in correct place assume not a valid key
- szExpandedKey$ = MID$(szMonthKey$, 1, 3) + " " + MID$(szMonthKey$,4,4) ''MMM YYYY
- ''weird string stuff - substring which is a number
- SELECT CASE MID$(szMonthKey$, 8)
- CASE INI_KEY_VGA
- szExpandedKey$ = szExpandedKey$ + " " + EXPANDED_VGA ''MMM YYYY RRR
- CASE INI_KEY_EGA
- szExpandedKey$ = szExpandedKey$ + " " + EXPANDED_EGA ''MMM YYYY RRR
- CASE INI_KEY_XGA
- szExpandedKey$ = szExpandedKey$ + " " + EXPANDED_XGA ''MMM YYYY RRR
- CASE INI_KEY_IND
- szExpandedKey$ = szExpandedKey$ + EXPANDED_IND ''MMM YYYY - don't add anything for independent
- CASE ELSE
- szExpandedKey$ = "" ''don't display other strings
- END SELECT
- ELSEIF szMonthKey$ = INI_KEY_COLORDATA THEN
- szExpandedKey$ = EXPANDED_COLORDATA
- ELSE
- szExpandedKey$ = "" ''String is not known, return empty
- END IF
- ExpandMonthKey = szExpandedKey$
- ''PRINT szExpandedKey$
- END FUNCTION
-
-