[D /LoadSW [P [A LoadFlag ] % LoadFlag = False -> Check only if Files are existing /Result #1 def /MissingFile '' def % Build SW File name /SWFile FilePath ApplSel.ApplDir add '\' add ApplSel.ApplSWFileName add ApplTypeExt add def /SWFile SWFile '_V' add ApplSel.SWVersion cvs add 'S' add ApplSel.SWSubVersion cvs add def ApplSel.SWBetaInfo '' ne [B /SWFile SWFile '_' add ApplSel.SWBetaInfo add def ] if /SWFile SWFile '.HX3' add def % Build Tree File name /TreeFile FilePath ApplSel.ApplDir add '\' add ApplSel.ApplTreeFileName add ApplTypeExt add def /TreeFile TreeFile '_V' add ApplSel.TreeVersion cvs add 'S' add ApplSel.TreeSubVersion cvs add def ApplSel.TreeBetaInfo '' ne [B /TreeFile TreeFile '_' add ApplSel.TreeBetaInfo add def ] if /TreeFile TreeFile '.HX2' add def % check if files are existing Result [B SWFile FileExist not [B /Result #0 def /MissingFile SWFile def ] if ] if Result [B TreeFile FileExist not [B /Result #0 def /MissingFile TreeFile def ] if ] if Result LoadFlag and [B % Read drive % Get Installation Valid Flag /InstVal APPLInstallValidAddr PackInst:ReadMemory def % Get SW CRC /CRC_drive_SW APPL_SW_CRC_Addr PackInst:_GetBlock def % Get Tree CRC /CRC_drive_Tr APPL_Tr_CRC_Addr PackInst:_GetBlock def % Get SW file name /Filename_read_SW APPL_SW_FileName_Addr GetInstalledFileName uppercase def % Get Tree file name /Filename_read_Tr APPL_Tr_FileName_Addr GetInstalledFileName uppercase def % Read file % Get SW CRC getcurrentdir '\' add SWFile add APPL_SW_CRC_Flash_Addr SystGen crcfromfile /Res exch def /CRC_file_SW exch def getcurrentdir '\' add SWFile add APPL_SW_CRC_EEPROM_Addr SystGen crcfromfile /Res exch def /CRC_file_SW_EEPROM exch def % Get Tree CRC getcurrentdir '\' add TreeFile add APPL_Tr_CRC_Flash_Addr SystGen crcfromfile /Res exch def /CRC_file_Tr exch def getcurrentdir '\' add TreeFile add APPL_Tr_CRC_EEPROM_Addr SystGen crcfromfile /Res exch def /CRC_file_Tr_EEPROM exch def % Get SW file name /Filename_file_SW SWFile extfilename '' chfileext uppercase def % Get Tree file name /Filename_file_Tr TreeFile extfilename '' chfileext uppercase def % Check CRC CRC_file_SW CRC_invalid1 eq CRC_file_SW CRC_invalid2 eq CRC_file_SW CRC_file_SW_EEPROM ne or or [B 'File: ' SWFile extfilename add ' is corrupted!' add log /Result #0 def ] if CRC_file_Tr CRC_invalid1 eq CRC_file_Tr CRC_invalid2 eq CRC_file_Tr CRC_file_Tr_EEPROM ne or or [B 'File: ' TreeFile extfilename add ' is corrupted!' add log /Result #0 def ] if Result [B InstVal InstallationValid ne [B SystGen 8 eq[B APPLSoftwareUpdateAddr InstallationValid WriteWordToElo APPLTreeUpdateAddr InstallationValid WriteWordToElo ]if SystGen 9 eq[B APPLSoftwareTreeUpdateAddr InstallationValid WriteWordToElo ]if APPLInstallValidAddr InstallationInvalid WriteWordToElo 'Clearing Appl Parameter Section...' log 4 PIVar:TalkIntf.ClearInstancePar 'Downloading ' SWFile add log SystGen 8 eq[B % erase old data in serial flash first 27 PIVar:TalkIntf.EraseSWInstance ]if SWFile dup loadobj exch PackInst:DownloadHX3FileNoFlashMem 'Downloading ' TreeFile add log SystGen 8 eq[B % erase old data in serial flash first 28 PIVar:TalkIntf.EraseSWInstance ]if TreeFile dup loadobj exch PackInst:DownloadHX2File ][B /InstallSW /StrLength Filename_file_SW length def %remove the E from the filename to compare /StrLength StrLength 1 sub def /Filename_file_SW Filename_file_SW 1 StrLength getsubstr def Filename_file_SW Filename_read_SW ne CRC_file_SW CRC_drive_SW ne or def /InstallTr /StrLength Filename_file_Tr length def %remove the E from the filename to compare /StrLength StrLength 1 sub def /Filename_file_Tr Filename_file_Tr 1 StrLength getsubstr def Filename_file_Tr Filename_read_Tr ne CRC_file_Tr CRC_drive_Tr ne or def InstallSW [B SystGen 8 eq[B APPLSoftwareUpdateAddr InstallationValid WriteWordToElo ]if SystGen 9 eq[B APPLSoftwareTreeUpdateAddr InstallationValid WriteWordToElo ]if APPLInstallValidAddr InstallationInvalid WriteWordToElo 'Downloading ' SWFile add log SystGen 8 eq[B % erase old data in serial flash first 27 PIVar:TalkIntf.EraseSWInstance ]if SWFile dup loadobj exch PackInst:DownloadHX3FileNoFlashMem ][B 'Download APPL SW firmware skipped. Already up to date...' log ] ifelse InstallTr [B SystGen 8 eq[B APPLTreeUpdateAddr InstallationValid WriteWordToElo ]if SystGen 9 eq[B APPLSoftwareTreeUpdateAddr InstallationValid WriteWordToElo ]if APPLInstallValidAddr InstallationInvalid WriteWordToElo 'Clearing Appl Parameter Section...' log 4 PIVar:TalkIntf.ClearInstancePar 'Downloading ' TreeFile add log SystGen 8 eq[B % erase old data in serial flash first 28 PIVar:TalkIntf.EraseSWInstance ]if TreeFile dup loadobj exch PackInst:DownloadHX2File 'Updating UPID list...' log TalkIntf.UpdateUPIDList TalkIntf.GetResult 0 ne [B IntfSel /IntfSpecificSetup known [B IntfSel.IntfSpecificSetup 'MIGenericSetup_NX_SG8' eq[B % wait for netX firmware installation to finish % only check the netX FW state if the interface was downloaded IntfSel.Name 'None' ne IntfSel.Name 'NoChange' ne and [B CheckNetXSWDownload not [B 'NX firmware download failed!' log /Continue FALSE def ] if ]if ] if ] if ] if ][B 'Download APPL Tree firmware skipped. Already up to date...' log ] ifelse ] ifelse ] if ] if [A /MissingFile /Result] ] ]