@@ -82,13 +82,13 @@ static Function CHI_CheckITCXOPVersion(STRUCT CHI_InstallationState &state)
8282End
8383
8484/// @brief Search list for matches of item and print the results
85- static Function CHI_CheckXOP ( string & list, string item, string name, STRUCT CHI_InstallationState &state, [ string expectedHash] )
85+ static Function CHI_CheckXOP ( WAVE /T list, string item, string name, STRUCT CHI_InstallationState &state, [ string expectedHash] )
8686
8787 variable numMatches, i , hashMatches
88- string matches , fileVersion, filepath, existingHash, hashMsg
88+ string fileVersion, filepath, existingHash, hashMsg
8989
90- matches = ListMatch ( list, "* " + item, FILE_LIST_SEP )
91- numMatches = ItemsInList ( matches, FILE_LIST_SEP )
90+ WAVE /Z/ T matches = GrepTextWave ( list, "(?i) " + item)
91+ numMatches = WaveExists ( matches) ? DimSize ( matches , ROWS ) : 0
9292
9393 if ( numMatches > 1 )
9494 if ( CheckIfPathsRefIdenticalFiles ( matches))
@@ -106,7 +106,7 @@ static Function CHI_CheckXOP(string &list, string item, string name, STRUCT CHI_
106106 state. numErrors += 1
107107 break
108108 case 1:
109- filepath = StringFromList ( 0, matches, FILE_LIST_SEP )
109+ filepath = matches[ 0 ]
110110 fileVersion = GetFileVersion ( filepath)
111111 if ( ParamIsDefault ( expectedHash))
112112 printf "%s: Found version %s (Nice!)\r " , name, fileVersion
@@ -119,10 +119,10 @@ static Function CHI_CheckXOP(string &list, string item, string name, STRUCT CHI_
119119 endif
120120 break
121121 default :
122- printf "%s: Found multiple versions in \" %s\" (Might create problems)\r " , name, matches
122+ printf "%s: Found multiple versions in \" %s\" (Might create problems)\r " , name, TextWaveToList ( matches, ", " , trailSep = 0 )
123123 printf "%s: Duplicates are:\r " , name
124124 for ( i = 0; i < numMatches; i += 1 )
125- filepath = StringFromList ( i , matches, FILE_LIST_SEP )
125+ filepath = matches[ i ]
126126 fileVersion = GetFileVersion ( filepath)
127127 if ( ParamIsDefault ( expectedHash))
128128 printf "%s: Found version %s\r " , name, fileVersion
@@ -224,26 +224,32 @@ End
224224Function CHI_CheckInstallation ()
225225
226226 string symbPath, allFiles, path, extName, info, igorBuild
227- string allFilesSystem, allFilesUser, listOfXOPs
228227 variable aslrEnabled, archBits, installedWithHW
229228
230229 symbPath = GetUniqueSymbolicPath ()
231230 extName = GetIgorExtensionFolderName ()
232231
233232 path = SpecialDirPath ( "Igor Pro User Files" , 0, 0, 0 ) + extName
234233 NewPath / Q/ O $ symbPath, path
235- allFilesUser = GetAllFilesRecursivelyFromPath ( symbPath)
234+ WAVE /Z/ T allFilesUser = GetAllFilesRecursivelyFromPath ( symbPath, regex = "(?i) \. xop$" , resolveAliases = 1 )
236235
237236 path = SpecialDirPath ( "Igor Application" , 0, 0, 0 ) + extName
238237 NewPath / Q/ O $ symbPath, path
239- allFilesSystem = GetAllFilesRecursivelyFromPath ( symbPath)
238+ WAVE /Z/ T allFilesSystem = GetAllFilesRecursivelyFromPath ( symbPath, regex = "(?i) \. xop$" , resolveAliases = 1 )
240239
241240 KillPath $ symbPath
242241
243- listOfXOPs = ListMatch ( allFilesUser + FILE_LIST_SEP + allFilesSystem, "*.xop" , FILE_LIST_SEP)
244- WAVE /T list = ListToTextWave ( listOfXOPs, FILE_LIST_SEP)
245- WAVE /T listNoDups = GetUniqueEntries ( list)
246- listOfXOPs = TextWaveToList ( listNoDups, FILE_LIST_SEP)
242+ if ( WaveExists ( allFilesUser) && WaveExists ( allFilesSystem))
243+ Concatenate / T/ FREE/ NP= ( ROWS) { allFilesUser, allFilesSystem} , listWithDuplicates
244+ elseif ( WaveExists ( allFilesUser))
245+ WAVE /T listWithDuplicates = allFilesUser
246+ elseif ( WaveExists ( allFilesSystem))
247+ WAVE /T listWithDuplicates = allFilesSystem
248+ else
249+ Make / FREE/ N=0/ T listWithDuplicates
250+ endif
251+
252+ WAVE /T listOfXOPs = GetUniqueEntries ( listWithDuplicates)
247253
248254 STRUCT CHI_InstallationState state
249255 CHI_InitInstallationState ( state)
0 commit comments