@@ -16,6 +16,9 @@ static StrConstant CHI_JSON_XOP_VERSION = "version-892-g9251933"
16
16
static StrConstant CHI_TUF_XOP_VERSION = "version-163-g686effb"
17
17
static StrConstant CHI_ITC_XOP_VERSION = "latest-174-gb9915a9"
18
18
19
+ static StrConstant CHI_INSTALLCONFIG_NAME = "installation_configuration.json"
20
+ static Constant CHI_INSTALLEDWITHHARDWAREDEFAULT = 1
21
+
19
22
/// @brief Collection of counters used for installation checking
20
23
static Structure C HI_InstallationState
21
24
variable numErrors
@@ -135,6 +138,37 @@ static Function CHI_CheckXOP(string &list, string item, string name, STRUCT CHI_
135
138
endswitch
136
139
End
137
140
141
+ /// @return JSON id or NaN if configuration file does not exist
142
+ static Function CHI_LoadInstallationConfiguration ()
143
+
144
+ string folder, fullFilePath, txt
145
+
146
+ folder = ParseFilePath ( 1, FunctionPath ( "" ) , ":" , 1, 1 )
147
+ fullFilePath = folder + CHI_INSTALLCONFIG_NAME
148
+ if ( ! FileExists ( fullFilePath))
149
+ return NaN
150
+ endif
151
+ [ txt, fullFilePath] = LoadTextFile ( fullFilePath)
152
+ return JSON_Parse ( txt, ignoreErr = 1 )
153
+ End
154
+
155
+ /// @return 1 if MIES was installed with hardware support, 0 otherwise
156
+ static Function CHI_IsMIESInstalledWithHardware ()
157
+
158
+ variable jsonId, installedWithHW
159
+
160
+ jsonId = CHI_LoadInstallationConfiguration ()
161
+ if ( IsNaN ( jsonId))
162
+ return CHI_INSTALLEDWITHHARDWAREDEFAULT
163
+ endif
164
+
165
+ installedWithHW = JSON_GetVariable ( jsonId, "/Installation/WithHardware" , ignoreErr = 1 )
166
+ JSON_Release ( jsonId)
167
+ ASSERT ( ! IsNaN ( installedWithHW) , "Could not find key in installation configuration file." )
168
+
169
+ return installedWithHW
170
+ End
171
+
138
172
/// @brief Check the installation and print the results to the history
139
173
///
140
174
/// Currently checks that all expected/optional XOPs are installed.
@@ -144,7 +178,7 @@ Function CHI_CheckInstallation()
144
178
145
179
string symbPath, allFiles, path, extName, info, igorBuild
146
180
string allFilesSystem, allFilesUser, listOfXOPs
147
- variable aslrEnabled, archBits
181
+ variable aslrEnabled, archBits, installedWithHW
148
182
149
183
symbPath = GetUniqueSymbolicPath ()
150
184
extName = GetIgorExtensionFolderName ()
@@ -235,10 +269,15 @@ Function CHI_CheckInstallation()
235
269
printf "Mies version info: Valid \" %s...\" (Nice!)\r " , StringFromList ( 0, miesVersion, "\r " )
236
270
endif
237
271
272
+ installedWithHW = CHI_IsMIESInstalledWithHardware ()
273
+ printf "Installation with hardware: %s\r " , ToTrueFalse ( installedWithHW)
274
+
238
275
#ifdef WINDOWS
239
- CHI_CheckXOP ( listOfXOPs, "itcxop2-64.xop" , "ITC XOP" , state)
240
- CHI_CheckXOP ( listOfXOPs, "AxonTelegraph64.xop" , "Axon Telegraph XOP" , state)
241
- CHI_CheckXOP ( listOfXOPs, "MultiClamp700xCommander64.xop" , "Multi Clamp Commander XOP" , state)
276
+ if ( installedWithHW)
277
+ CHI_CheckXOP ( listOfXOPs, "itcxop2-64.xop" , "ITC XOP" , state)
278
+ CHI_CheckXOP ( listOfXOPs, "AxonTelegraph64.xop" , "Axon Telegraph XOP" , state)
279
+ CHI_CheckXOP ( listOfXOPs, "MultiClamp700xCommander64.xop" , "Multi Clamp Commander XOP" , state)
280
+ endif
242
281
#endif // WINDOWS
243
282
244
283
// one operation/function of each non-hardware XOP needs to be called in CheckCompilation_IGNORE()
@@ -264,7 +303,9 @@ Function CHI_CheckInstallation()
264
303
CHI_InitInstallationState ( stateExtended)
265
304
printf "\r Checking extended installation:\r "
266
305
267
- CHI_CheckXOP ( listOfXOPs, "NIDAQmx64.xop" , "NI-DAQ MX XOP" , stateExtended, expectedHash = CHI_NIDAQ_XOP_64 _HASH)
306
+ if ( installedWithHW)
307
+ CHI_CheckXOP ( listOfXOPs, "NIDAQmx64.xop" , "NI-DAQ MX XOP" , stateExtended, expectedHash = CHI_NIDAQ_XOP_64 _HASH)
308
+ endif
268
309
269
310
printf "Results: %d checks, %d number of errors\r " , stateExtended. numTries, stateExtended. numErrors
270
311
#endif // WINDOWS
0 commit comments