@@ -18,7 +18,7 @@ import FileWriteError from '../../../model/errors/FileWriteError';
18
18
import FileUtils from '../../../utils/FileUtils' ;
19
19
import { GetInstallerIdForLoader , GetInstallerIdForPlugin } from '../../../model/installing/PackageLoader' ;
20
20
import { PackageInstallerId , PackageInstallers } from "../../../installers/registry" ;
21
- import { InstallArgs , PackageInstallerV2 } from "../../../installers/PackageInstaller" ;
21
+ import { InstallArgs } from "../../../installers/PackageInstaller" ;
22
22
import { InstallRuleInstaller } from "../../../installers/InstallRuleInstaller" ;
23
23
import { ShimloaderPluginInstaller } from "../../../installers/ShimloaderInstaller" ;
24
24
import { ReturnOfModdingPluginInstaller } from "../../../installers/ReturnOfModdingInstaller" ;
@@ -289,7 +289,8 @@ export default class GenericProfileInstaller extends ProfileInstallerProvider {
289
289
}
290
290
291
291
async uninstallMod ( mod : ManifestV2 , profile : Profile ) : Promise < R2Error | null > {
292
- // Implementations of PackageInstallerV2 define their own uninstallation logic.
292
+ // Support for installer specific uninstall methods are rolled out
293
+ // gradually and therefore might not be defined yet.
293
294
try {
294
295
if (
295
296
await this . uninstallModLoaderWithInstaller ( mod , profile ) ||
@@ -319,7 +320,8 @@ export default class GenericProfileInstaller extends ProfileInstallerProvider {
319
320
}
320
321
321
322
/**
322
- * Uninstall mod if it's a registered mod loader with PackageInstallerV2 implementation
323
+ * Uninstall mod if it's a registered mod loader and the installer class
324
+ * implements a custom uninstallation method.
323
325
* @return true if mod loader was uninstalled
324
326
*/
325
327
async uninstallModLoaderWithInstaller ( mod : ManifestV2 , profile : Profile ) : Promise < boolean > {
@@ -329,7 +331,8 @@ export default class GenericProfileInstaller extends ProfileInstallerProvider {
329
331
}
330
332
331
333
/**
332
- * Uninstall mod if its registered installer implements PackageInstallerV2
334
+ * Uninstall mod if its registered installer implements a custom
335
+ * uninstallation method.
333
336
* @return true if mod was uninstalled
334
337
*/
335
338
async uninstallModWithInstaller ( mod : ManifestV2 , profile : Profile ) : Promise < boolean > {
@@ -344,7 +347,7 @@ export default class GenericProfileInstaller extends ProfileInstallerProvider {
344
347
) : Promise < boolean > {
345
348
const installer = installerId ? PackageInstallers [ installerId ] : undefined ;
346
349
347
- if ( installer && installer instanceof PackageInstallerV2 ) {
350
+ if ( installer && installer . uninstall ) {
348
351
const args = this . getInstallArgs ( mod , profile ) ;
349
352
await installer . uninstall ( args ) ;
350
353
return true ;
0 commit comments