@@ -100,10 +100,8 @@ InstallerWindow::InstallerWindow(QWidget* parent) : QMainWindow(parent)
100100 hideGuiCheck_ = new QCheckBox (tr (" Hide GUI/CLI after successful runs" ), central);
101101 layout->addWidget (hideGuiCheck_);
102102
103- #if defined(Q_OS_WIN)
104103 copyCliOnlyCheck_ = new QCheckBox (tr (" Copy only the CLI version (reduces the size)" ), central);
105104 layout->addWidget (copyCliOnlyCheck_);
106- #endif
107105
108106 installButton_ = new QPushButton (tr (" Install PyAppExec" ), central);
109107 installButton_->setFixedWidth (220 );
@@ -237,11 +235,9 @@ SettingsModel InstallerWindow::gatherSettings() const
237235 settings.iconPath = iconPathEdit_->text ().trimmed ();
238236 }
239237 settings.hideGuiAfterSuccess = hideGuiCheck_->isChecked ();
240- #if defined(Q_OS_WIN)
241238 if (copyCliOnlyCheck_) {
242239 settings.copyCliOnly = copyCliOnlyCheck_->isChecked ();
243240 }
244- #endif
245241 return settings;
246242}
247243
@@ -304,11 +300,9 @@ void InstallerWindow::handleInstall()
304300
305301 logMessage (tr (" Generated %1" ).arg (createdIni));
306302 logMessage (tr (" Copied launcher as %1" ).arg (settings.launcherArtifactName ()));
307- #if defined(Q_OS_WIN)
308303 if (settings.copyCliOnly ) {
309- logMessage (tr (" CLI-only mode: skipped copying Qt and other adjacent DLLs ." ));
304+ logMessage (tr (" CLI-only mode: using the command-line launcher instead of the GUI binary ." ));
310305 }
311- #endif
312306
313307 QDesktopServices::openUrl (QUrl::fromLocalFile (createdIni));
314308 QMessageBox::information (this , tr (" Success" ), tr (" PyAppExec was installed for %1" ).arg (settings.appName ));
@@ -433,16 +427,15 @@ void InstallerWindow::showAboutQtDialog()
433427void InstallerWindow::updateActionButtons ()
434428{
435429 const bool hasProject = !projectPathEdit_->text ().trimmed ().isEmpty ();
430+ const QString iniPath = hasProject
431+ ? QDir (projectPathEdit_->text ()).filePath (QStringLiteral (" pyappexec.ini" ))
432+ : QString ();
433+ const bool hasIni = hasProject && QFileInfo::exists (iniPath);
434+
436435 if (installButton_) {
437436 installButton_->setEnabled (hasProject);
438437 }
439438
440- #if defined(Q_OS_WIN)
441- bool hasIni = false ;
442- if (hasProject) {
443- const QString iniPath = QDir (projectPathEdit_->text ()).filePath (QStringLiteral (" pyappexec.ini" ));
444- hasIni = QFileInfo::exists (iniPath);
445- }
446439 if (uninstallButton_) {
447440 uninstallButton_->setEnabled (hasProject && hasIni);
448441 if (!hasIni) {
@@ -451,7 +444,6 @@ void InstallerWindow::updateActionButtons()
451444 uninstallButton_->setToolTip (QString ());
452445 }
453446 }
454- #endif
455447}
456448
457449} // namespace installer
0 commit comments