@@ -2317,6 +2317,7 @@ Public Class AddProvAppxPackage
2317
2317
2318
2318
Private Sub ListView1_DragDrop(sender As Object , e As DragEventArgs) Handles ListView1.DragDrop
2319
2319
Dim PackageFiles() As String = e.Data.GetData(DataFormats.FileDrop)
2320
+ Dim HasBeenScannedByAppInstaller As Boolean = False
2320
2321
Cursor = Cursors.WaitCursor
2321
2322
DynaLog.LogMessage( "Interpreting items to add to queue..." )
2322
2323
For Each PackageFile In PackageFiles
@@ -2325,13 +2326,24 @@ Public Class AddProvAppxPackage
2325
2326
Path.GetExtension(PackageFile).Equals( ".eappx" , StringComparison.OrdinalIgnoreCase) Or Path.GetExtension(PackageFile).Equals( ".emsix" , StringComparison.OrdinalIgnoreCase) Or
2326
2327
Path.GetExtension(PackageFile).Equals( ".eappxbundle" , StringComparison.OrdinalIgnoreCase) Or Path.GetExtension(PackageFile).Equals( ".emsixbundle" , StringComparison.OrdinalIgnoreCase) Then
2327
2328
DynaLog.LogMessage( "The item to add " & Quote & Path.GetFileName(PackageFile) & Quote & " is a regular AppX package." )
2328
- ScanAppxPackage( False , PackageFile)
2329
+ If Not HasBeenScannedByAppInstaller Then
2330
+ ScanAppxPackage( False , PackageFile)
2331
+ Else
2332
+ ' The item has been detected by the app installer package, but the resulting package is already present,
2333
+ ' so instead of scanning it again, we get rid of an error by ignoring the second scan. Instead of re-scanning
2334
+ ' the package, we set this flag to false so that we can get more stuff.
2335
+ HasBeenScannedByAppInstaller = False
2336
+ End If
2329
2337
ElseIf Path.GetExtension(PackageFile).Equals( ".appinstaller" , StringComparison.OrdinalIgnoreCase) Then
2330
2338
DynaLog.LogMessage( "The item to add " & Quote & Path.GetFileName(PackageFile) & Quote & " is an App Installer package." )
2331
2339
If Not AppInstallerDownloader.IsDisposed Then AppInstallerDownloader.Dispose()
2332
2340
AppInstallerDownloader.AppInstallerFile = PackageFile
2333
- If Not File.Exists(PackageFile.Replace( ".appinstaller" , GetDownloadedPackageExtensionFromAppInstaller(PackageFile))) Then AppInstallerDownloader.ShowDialog( Me )
2334
- If File.Exists(PackageFile.Replace( ".appinstaller" , GetDownloadedPackageExtensionFromAppInstaller(PackageFile)).Trim()) Then ScanAppxPackage( False , PackageFile.Replace( ".appinstaller" , GetDownloadedPackageExtensionFromAppInstaller(PackageFile)).Trim())
2341
+ If Not File.Exists(PackageFile.Replace( ".appinstaller" , GetDownloadedPackageExtensionFromAppInstaller(PackageFile))) Then
2342
+ AppInstallerDownloader.ShowDialog( Me )
2343
+ Else
2344
+ ScanAppxPackage( False , PackageFile.Replace( ".appinstaller" , GetDownloadedPackageExtensionFromAppInstaller(PackageFile)).Trim())
2345
+ HasBeenScannedByAppInstaller = True
2346
+ End If
2335
2347
ElseIf (File.GetAttributes(PackageFile) And FileAttributes.Directory) = FileAttributes.Directory Then
2336
2348
DynaLog.LogMessage( "The item to add is a directory. Getting contents..." )
2337
2349
Dim msg As String = ""
0 commit comments