@@ -220,11 +220,14 @@ public static void RefreshDownloadableModuleList()
220
220
/// from the ModuleConfig.
221
221
/// </summary>
222
222
/// <param name="module">A ModuleConfig object</param>
223
+ /// <param name="moduleStorageUrl">The location of the module download
224
+ /// packages</param>
223
225
/// <param name="isInstalled">Is this module currently installed?</param>
224
226
/// <param name="serverVersion">The version of the current server, or null to ignore
225
227
/// version checks</param>
226
228
/// <returns>A ModuleDescription object</returns>
227
229
public static ModuleDescription ModuleDescriptionFromModuleConfig ( ModuleConfig module ,
230
+ string moduleStorageUrl ,
228
231
bool isInstalled ,
229
232
string serverVersion )
230
233
{
@@ -240,7 +243,8 @@ public static ModuleDescription ModuleDescriptionFromModuleConfig(ModuleConfig m
240
243
241
244
// Set initial properties. Most importantly it sets the status.
242
245
moduleDescription . Initialise ( serverVersion , module . ModuleDirPath ,
243
- module . InstallOptions ! . ModuleLocation ) ;
246
+ moduleStorageUrl ,
247
+ module . InstallOptions ! . ModuleLocation ) ;
244
248
245
249
// if a module is installed then that beats any other status
246
250
if ( isInstalled )
@@ -323,6 +327,7 @@ public async Task<List<ModuleDescription>> GetInstallableModulesAsync()
323
327
+ Path . DirectorySeparatorChar
324
328
+ downloadableModule . ModuleId ;
325
329
downloadableModule . Initialise ( currentServerVersion , moduleDirPath ,
330
+ _moduleOptions . ModuleStorageUrl ! ,
326
331
ModuleLocation . Internal ) ;
327
332
}
328
333
@@ -467,6 +472,7 @@ public async Task<List<ModuleDescription>> GetInstallableModulesAsync()
467
472
// "module.InstallOptions?.PreInstalled" is the setting for the currently installed
468
473
// module, not the module that can be downloaded.
469
474
// GIVEN ALL THAT: who cares. We can totally uninstall / reinstall something pre-installed.
475
+
470
476
// if (module is not null && module.InstallOptions?.PreInstalled == true)
471
477
// return (false, $"Module description for '{moduleId}' is invalid. A 'pre-installed' module can't be downloaded");
472
478
@@ -484,6 +490,7 @@ public async Task<List<ModuleDescription>> GetInstallableModulesAsync()
484
490
// Download and unpack the module's installation package FOR THE REQUESTED VERSION
485
491
// string moduleDirName = _moduleSettings.GetModuleDirPath(moduleDownload);
486
492
// string moduleDirName = moduleDownload.ModuleDirPath;
493
+ // TODO: Generalise this in a utility method
487
494
string downloadDirPath = _moduleSettings . DownloadedModulePackagesDirPath
488
495
+ Path . DirectorySeparatorChar + moduleId + "-" + version + ".zip" ;
489
496
@@ -843,7 +850,9 @@ await logWriter.WriteLineAsync($"Unable to install Module '{moduleId}' ({e.Messa
843
850
// to the download list so at least we can provide updates on it disappearing.
844
851
if ( moduleDownload is null )
845
852
{
846
- moduleDownload = ModuleDescriptionFromModuleConfig ( module , true ,
853
+ moduleDownload = ModuleDescriptionFromModuleConfig ( module ,
854
+ _moduleOptions . ModuleStorageUrl ! ,
855
+ true ,
847
856
_versionConfig . VersionInfo ! . Version ) ;
848
857
moduleDownload . IsDownloadable = false ;
849
858
}
0 commit comments