@@ -875,7 +875,7 @@ bool main_window::InstallFileInExData(const std::string& extension, const QStrin
875875 return to.commit ();
876876}
877877
878- bool main_window::InstallPackages (main_window* mw, QStringList file_paths, bool from_boot)
878+ bool main_window::InstallPackages (main_window* mw, QStringList file_paths, bool from_boot, bool from_optical_drive )
879879{
880880 if (file_paths.isEmpty ())
881881 {
@@ -920,7 +920,7 @@ bool main_window::InstallPackages(main_window* mw, QStringList file_paths, bool
920920 return true ;
921921 }
922922
923- return InstallPackages (mw, dir_file_paths, from_boot);
923+ return InstallPackages (mw, dir_file_paths, from_boot, from_optical_drive );
924924 }
925925 }
926926
@@ -980,26 +980,23 @@ bool main_window::InstallPackages(main_window* mw, QStringList file_paths, bool
980980
981981 if (from_boot)
982982 {
983- return HandlePackageInstallation (mw, file_paths, true );
983+ return HandlePackageInstallation (mw, file_paths, true , from_optical_drive );
984984 }
985985
986- // Handle further installations with a timeout. Otherwise the source explorer instance is not usable during the following file processing.
987986 if (mw)
988987 {
989- QTimer::singleShot (0 , [mw, paths = std::move (file_paths)]()
988+ // Handle further installations with a timeout. Otherwise the source explorer instance is not usable during the following file processing.
989+ QTimer::singleShot (0 , [mw, from_optical_drive, paths = std::move (file_paths)]()
990990 {
991- HandlePackageInstallation (mw, paths, false );
991+ HandlePackageInstallation (mw, paths, false , from_optical_drive );
992992 });
993- }
994- else
995- {
996- return HandlePackageInstallation (nullptr , file_paths, false );
993+ return true ;
997994 }
998995
999- return true ;
996+ return HandlePackageInstallation ( nullptr , file_paths, false , from_optical_drive) ;
1000997}
1001998
1002- bool main_window::HandlePackageInstallation (main_window* mw, QStringList file_paths, bool from_boot)
999+ bool main_window::HandlePackageInstallation (main_window* mw, QStringList file_paths, bool from_boot, bool from_optical_drive )
10031000{
10041001 if (file_paths.empty ())
10051002 {
@@ -1129,9 +1126,9 @@ bool main_window::HandlePackageInstallation(main_window* mw, QStringList file_pa
11291126 std::deque<std::string> bootable_paths;
11301127
11311128 // Run PKG unpacking asynchronously
1132- named_thread worker (" PKG Installer" , [&readers, &result, &bootable_paths]
1129+ named_thread worker (" PKG Installer" , [&readers, &result, &bootable_paths, from_optical_drive ]
11331130 {
1134- result = package_reader::extract_data (readers, bootable_paths);
1131+ result = package_reader::extract_data (readers, bootable_paths, from_optical_drive );
11351132 return result.error == package_install_result::error_type::no_error;
11361133 });
11371134
0 commit comments