Post
by ksimmons » Tue Aug 19, 2003 1:39 pm
I have ran the debugger with watch list and enabled the logging. It still does not give help me fix this problem. Here is my program:
// Variables
Let>file=%WIN_DIR%
//get the drive letter
MidStr>%file%,1,2,driveletter
//MessageModal>%driveletter%
Let>logFileName=%driveletter%\dms\ServerInstaller\TSIU.log
Let>svrDataFile=%driveletter%\dms\ServerInstaller\ServerInstall.ini
Let>fileLoc=%driveletter%\dms\ServerInstaller\
// Read a string from the ini file
Let>iniFile=%driveletter%\dms\ServerInstaller\ServerInstall.ini
// get each part of the date separately
Day>the_day
Month>the_month
Year>the_year
// get each part of the time
Sec>Seconds
Min>Minutes
Hour>Hour
//--------- Make sure Pre-requisite files are present --------------------
// First make sure the log file doesn't exist, if so, delete it
IfFileExists>%logFileName%,DeleteLogFile
Goto>OpenLog
Label>DeleteLogFile
DeleteFile>%logFileName%
// Now create a log file
Label>OpenLog
// This code was created to open a log file and log messages throughtout the install
// example) 01-15-2003 12:53:20 3000 Macro completed successfully
// The log file format for date and time append to each line entry
Let>the_time=%Hour%:%Minutes%:%Seconds%
Let>logFileDate=%the_month%-%the_day%-%the_year% %the_time%
Label>FindFiles
// Check for the require files that store the X.400 Connectors information
// Check for ServerInstall.ini
IfFileExists>%svrDataFile%,Main
Goto>checkFileError
Label>checkFileError
Ask>The program cannot find the ServerInstall.ini file.%CRLF%Please verify the file exists in the following location: %svrDataFile%. %CRLF%Click Yes to proceed or NO to quit the program,continue
If>%continue%=NO,msg1,msg2
Label>msg1
MessageModal>Program was unable to complete.
WriteLn>%logFileName%,result,%logFileDate% 4999 The ServerInstall.ini file was not present to complete the install.
Goto>end
Label>msg2
Goto>FindFiles
//--------------- Main Part of the script ----------------------------------
Label>Main
// Write a message
WriteLn>%logFileName%,result,%logFileDate% 4000 Entering the script to create X.400 connectors
Gosub>FindExchSrvr
Wait>4
// This result lets us know when to end the loop
ReadIniFile>%iniFile%,X.400 Connectors,numberofx400Connectors,result
MessageModal>The number of connectors being created are: %result%
// Check to make sure there are connectors in this ini file
If>%result%readfile
Label>errorMsg
MessageModal>Unable to create connectors because numberofConnectors= %result% .%CRLF%You must specify at least one connector.
WriteLn>%logFileName%,result,%logFileDate% 4999 There numberofConnectors specified in the ServerInstall.ini file was set to 0.
Goto>end
Label>readfile
Let>k=0
Repeat>k
Let>connect=Connector
Let>i=k+1
//MessageModal>%i%
Concat>%connect%,%i%
WriteLn>%logFileName%,result,%logFileDate% 4000 Setup %connect% :
ReadIniFile>%iniFile%,%connect%,displayName,result1
WriteLn>%logFileName%,result,%logFileDate% 4000 display Name: %result1%
If>%result1%=,errormsg1,cont
Label>errormsg1
WriteLn>%logFileName%,result,%logFileDate% 4999 See the ServerInstall.ini file and check displayName=%result1%
MessageModal>Did not fill in the display name: %result1% in the ServerInstaller.ini file
Goto>end
Label>cont
ReadIniFile>%iniFile%,%connect%,directoryName,dirname
WriteLn>%logFileName%,result,%logFileDate% 4000 directoryName: %dirname%
If>%dirname%=,errormsg2,getmta
Label>errormsg2
WriteLn>%logFileName%,result,%logFileDate% 4999 See the ServerInstall.ini file and check directoryName=%dirname%
MessageModal>Did not fill in the directory name: %dirname% in the ServerInstaller.ini file
Goto>end
Label>getmta
ReadIniFile>%iniFile%,%connect%,remoteMTAName,result2
WriteLn>%logFileName%,result,%logFileDate% 4000 remoteMTAName: %result2%
If>%result2%=,errormsg3,getpasswd
Label>errormsg3
WriteLn>%logFileName%,result,%logFileDate% 4999 See the ServerInstall.ini file and check remoteMTAName=%result2%
MessageModal>Did not fill in the remote MTA name: %result2% in the ServerInstaller.ini file
Goto>end
Label>getpasswd
ReadIniFile>%iniFile%,%connect%,remoteMTAPassword,passwd
If>%passwd%=,errormsg,getIP
Label>errormsg
WriteLn>%logFileName%,result,%logFileDate% 4999 See the ServerInstall.ini file and check remoteMTAPassword=%passwd%
MessageModal>Did not fill in the remoteMTAPassword: %passwd% in the ServerInstaller.ini file
Goto>end
Label>getIP
// may not need this parameter
ReadIniFile>%iniFile%,%connect%,addressIsHostOrIP,result4
WriteLn>%logFileName%,result,%logFileDate% 4000 IP Address: %result4%
ReadIniFile>%iniFile%,%connect%,remoteAddress,result5
WriteLn>%logFileName%,result,%logFileDate% 4000 remoteAddress: %result5%
ReadIniFile>%iniFile%,%connect%,checkpointSize,result6
WriteLn>%logFileName%,result,%logFileDate% 4000 checkpointsize: %result6%
ReadIniFile>%iniFile%,%connect%,windowSize,result7
WriteLn>%logFileName%,result,%logFileDate% 4000 windowsize: %result7%
ReadIniFile>%iniFile%,%connect%,primaryMTA_Country,result8
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA Country: %result8%
ReadIniFile>%iniFile%,%connect%,primaryMTA_ADMD,result9
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA_ADMD: %result9%
ReadIniFile>%iniFile%,%connect%,primaryMTA_PRMD,res10
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA_PRMD: %res10%
ReadIniFile>%iniFile%,%connect%,primaryMTA_Org,res11
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA_Org: %res11%
ReadIniFile>%iniFile%,%connect%,primaryMTA_Unit,res12
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA_Unit: %res12%
ReadIniFile>%iniFile%,%connect%,primaryMTA_Weight,res13
WriteLn>%logFileName%,result,%logFileDate% 4000 MTA_Weight: %res13%
Let>k=k+1
Wait>8
//go to fill tabs subrountines
Gosub>OpenPropertiesWindow
Gosub>FillGeneralTab
Gosub>FillStackTab
// repeat until k=result
Until>k,%result%
//--------------- End of Main ----------------------------------
//////////////// Subroutines Beginning /////////////////////////////////////////
SRT>FindExchSrvr
// Locate the exchange server's
WriteLn>%logFileName%,result,%logFileDate% 4000 Entering FindExchSrvr ....
WriteLn>%logFileName%,result,%logFileDate% 4000 Locate the exchange server location
RegistryReadKey>HKEY_LOCAL_MACHINE,Software\Microsoft\Exchange\Setup,Services,exchsrvrLoc
//MessageModal>%exchsrvrLoc% //Debug: displays drive letter of the exchange server
IfFileExists>%exchsrvrLoc%\bin\Admin.exe,StartExchange
WriteLn>%logFileName%,result,%logFileDate% 4000 Found exchange svr at: %exchsrvrLoc%\bin\
// add later: if file does not exists ask user to start up exchange server and maximize the windows
Label>StartExchange
// Start Exchange Server
Let>svrFileName=%exchsrvrLoc%\bin\Admin.exe
// suppress the windows error messages
// Let>RP_DISPLAYERROR=0
Run Program>%svrFileName%
WriteLn>%logFileName%,result,%logFileDate% 4000 Return value after launching server %RP_Result%
If>RP_Result>31,maxWin
WriteLn>%logFileName%,result,%logFileDate% 4999 Exchange Server did not launch correctly
Goto>end
Label>maxWin
WaitWindowOpen>Microsoft Exchange Administrator*
WaitReady>10
WindowAction>1,Microsoft Exchange Administrator*
WriteLn>%logFileName%,result,%logFileDate% 4000 Maximized exchange server window
WriteLn>%logFileName%,result,%logFileDate% 4000 Exiting FindExchSrvr ....
END>FindExchSrvr
SRT>OpenPropertiesWindow
// This subrountine will fill in each the General Tab's requirements
WriteLn>%logFileName%,result,%logFileDate% 4000 Entering OpenPropertiesWindow ....
//MessageModal>Entering FillTabs subroutine ....
// If find x.400 connectors line in the file then
// start reading the lines
SetFocus>Microsoft Exchange Administrator*
Press ALT
Send>fnx
Release ALT
// open the window
WaitWindowOpen>New X.400 Connector*
PushButton>New X.400 Connector,OK
//Press Enter //may need to add if PushButton does not work
WriteLn>%logFileName%,result,%logFileDate% 4000 Open X.400 Connector window
// there maybe a pop-up window, click OK to this window
IfWindowOpen>Microsoft Exchange Administrator*,clickOK1
Goto>Done
Label>clickOK1
PushButton>Microsoft Exchange Administrator*,OK
// Now read the data from the ServerInstall.ini fill to fill in the required information
Label>Done
WaitWindowOpen>Properties*
WriteLn>%logFileName%,result,%logFileDate% 4000 Exiting OpenPropertiesWindow ....
END>OpenPropertiesWindow
SRT>FillGeneralTab
// Fill in Display name field
Send>%result1%
Wait>2
// Fill in directory name field
Press Tab
Send>%dirname%
Wait>2
// Fill in RemoteMTA name field
//Press ALT
//Send>m
Press Tab
Send>%result2%
Wait>2
// Fill in Remote MTA password - used default "password"
//Press ALT
//Send>p
Press Tab
Send>%passwd%
END>FillGeneralTab
SRT>FillStackTab
**BREAKPOINT**
Wait>8
Press LCTRL
Press Tab*3
Release LCTRL
Wait>6
// select IP address radio button
SetFocus>Properties*
Wait>10
MessageModal>pressing alt key...
Press ALT
Wait>4
MessageModal>pressing i key ...
Send>I
Release ALT
// input the IP address number
Goto>end
Wait>2
Press Tab
Send>%result5%
Wait>2
// Fill in the Outgoing OSI address information
Press Tab
Send>A300
Wait>2
Press Tab
Send>A200
Wait>2
Press Tab
Send>A100
Wait>2
// Fill in the Outgoing OSI address information
Press Tab
Send>A300
Wait>2
Press Tab
Send>A200
Wait>2
Press Tab
Send>A100
END>FillStackTab
//////////////// Subroutines End /////////////////////////////////////////
//////////////////// Labels here /////////////////////////////////////////
Label>end
Kina