@@ -110,17 +110,6 @@ private static void LaunchApplicationAndExit(string applicationToLaunch, bool fo
110110 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
111111 private static void DownloadModAndExit ( string downloadUrl )
112112 {
113- var loaderConfig = IoC . Get < LoaderConfig > ( ) ;
114- var modConfigDir = loaderConfig . GetModConfigDirectory ( ) ;
115- var modConfig = ModConfig . GetAllMods ( modConfigDir ) ;
116- var allAppsList = ApplicationConfig . GetAllApplications ( loaderConfig . GetApplicationConfigDirectory ( ) ) ;
117- var allApps = new ObservableCollection < PathTuple < ApplicationConfig > > ( allAppsList ) ;
118- var oldItemsById = modConfig . ToDictionary (
119- x => x . Config . ModId ,
120- x => x ,
121- StringComparer . OrdinalIgnoreCase
122- ) ;
123-
124113 if ( downloadUrl . StartsWith ( $ "{ Constants . ReloadedProtocol } :", StringComparison . InvariantCultureIgnoreCase ) )
125114 downloadUrl = downloadUrl . Substring ( Constants . ReloadedProtocol . Length + 1 ) ;
126115
@@ -131,6 +120,28 @@ private static void DownloadModAndExit(string downloadUrl)
131120 Actions . ShowFetchPackageDialog ( viewModel ) ;
132121 Update . ResolveMissingPackages ( ) ;
133122
123+ // Ensure downloaded mod(s) all at least advertise 1 compatible App (if not universal)
124+ AssertAllModsHaveAtLeastOneCompatibleApp ( ) ;
125+
126+ Actions . DisplayMessagebox ( Resources . PackageDownloaderDownloadCompleteTitle . Get ( ) , Resources . PackageDownloaderDownloadCompleteDescription . Get ( ) , new Actions . DisplayMessageBoxParams ( )
127+ {
128+ Type = Actions . MessageBoxType . Ok ,
129+ StartupLocation = Actions . WindowStartupLocation . CenterScreen ,
130+ Timeout = TimeSpan . FromSeconds ( 8 )
131+ } ) ;
132+ }
133+
134+ private static void AssertAllModsHaveAtLeastOneCompatibleApp ( )
135+ {
136+ var loaderConfig = IoC . Get < LoaderConfig > ( ) ;
137+ var modConfigDir = loaderConfig . GetModConfigDirectory ( ) ;
138+ var modConfig = ModConfig . GetAllMods ( modConfigDir ) ;
139+ var oldItemsById = modConfig . ToDictionary (
140+ x => x . Config . ModId ,
141+ x => x ,
142+ StringComparer . OrdinalIgnoreCase
143+ ) ;
144+
134145 modConfig = ModConfig . GetAllMods ( modConfigDir ) ;
135146 var itemsById = modConfig . ToDictionary ( x => x . Config . ModId , x => x , StringComparer . OrdinalIgnoreCase ) ;
136147 foreach ( var item in itemsById . ToArray ( ) )
@@ -143,13 +154,6 @@ private static void DownloadModAndExit(string downloadUrl)
143154 IoC . Get < ModConfigService > ( ) ) ;
144155 }
145156 }
146-
147- Actions . DisplayMessagebox ( Resources . PackageDownloaderDownloadCompleteTitle . Get ( ) , Resources . PackageDownloaderDownloadCompleteDescription . Get ( ) , new Actions . DisplayMessageBoxParams ( )
148- {
149- Type = Actions . MessageBoxType . Ok ,
150- StartupLocation = Actions . WindowStartupLocation . CenterScreen ,
151- Timeout = TimeSpan . FromSeconds ( 8 )
152- } ) ;
153157 }
154158
155159 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
0 commit comments