Skip to content

Commit

Permalink
"Updating"
Browse files Browse the repository at this point in the history
  • Loading branch information
adgellida committed Dec 8, 2018
1 parent d6fb457 commit 3485b82
Show file tree
Hide file tree
Showing 9 changed files with 1,567 additions and 1,289 deletions.
2 changes: 1 addition & 1 deletion src/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void MainWindow::on_actionAbout_triggered()
"<p align='left'><a href='https://github.com/adgellida/winsys'>Git Repo</a></p></br>"));

about.setInformativeText(tr("Copyright (c) 2017 all rights reserved\n\n\GPL v2\n\nAntonio David Gellida Lavara\n\nadgellida@gmail.com\n\n"
"v2018.10.29"));
"v2018.12.08"));

about.setWindowTitle(tr("About"));
about.setStandardButtons(QMessageBox::Ok);
Expand Down
8 changes: 6 additions & 2 deletions src/installtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ void MainWindow::on_runStopUpdates10Button_clicked()
void MainWindow::on_runUltimateWindowsTweaker4Button_clicked()
{
ui->statusBar->showMessage(tr("Running ChrisPC Win Experience Index"));
system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"cd scripts\\windowsScripts-master; & ./011.runUltimateWindowsTweaker4.ps1; sleep 2;""\"");
//system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"cd scripts\\windowsScripts-master; & ./011.runUltimateWindowsTweaker4.ps1; sleep 2;""\"");

QString link = "https://www.thewindowsclub.com/your-download-of-uwt4-will-start-in-5-seconds";
QDesktopServices::openUrl(QUrl(link));

ui->statusBar->showMessage(tr("Done. Now select another action"));
}

Expand All @@ -62,7 +66,7 @@ void MainWindow::on_run10AppsManager_clicked()
ui->statusBar->showMessage(tr("Running 10AppsManager"));
//system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"cd scripts\\windowsScripts-master; & ./012.run10AppsManager.ps1; sleep 2;""\"");

QString link = "https://www.thewindowsclub.com/10appsmanager-windows-10";
QString link = "https://www.thewindowsclub.com/downloading-10appsmanager";
QDesktopServices::openUrl(QUrl(link));

ui->statusBar->showMessage(tr("Done. Now select another action"));
Expand Down
78 changes: 10 additions & 68 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ MainWindow::MainWindow(QWidget *parent) :
if(!file.exists())
{
//Install/Upgrade Package
//system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"& ./027.chocoWinsysPackageInstall.ps1; sleep 2;""\"");
system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"& ./027.chocoWinsysPackageInstall.ps1; sleep 2;""\"");
}
else
{
//Update scripts
on_updateScriptsButton_clicked();
on_actionUpdate_Scripts_triggered();
}

//Check services
checkServicesStatus();
//checkServicesStatus();

ui->statusBar->showMessage(tr("Recommendation: Push Help -> Tutorial"));

Expand Down Expand Up @@ -115,78 +115,20 @@ void MainWindow::checkInstallAppUpdate() //Not used
}
}

void MainWindow::checkServicesStatus()
{

ui->statusBar->showMessage(tr("Running"));
system("@powershell -NoProfile -ExecutionPolicy Bypass -Command \"cd scripts\\windowsScripts-master; & ./getWindowsUpdateStatus.ps1; sleep 2;""\"");
ui->statusBar->showMessage(tr("Done. Now select another action"));

QFile fileUpdate(QDir::currentPath() + "/scripts/windowsScripts-master/updateStatus.txt");
//QLabel *testLabel= new QLabel;

QString lineUpdate1;
if (fileUpdate.open(QIODevice::ReadOnly | QIODevice::Text)){
QTextStream stream(&fileUpdate);
while (!stream.atEnd()){

//line.append(stream.readLine()+"\n");
lineUpdate1.append(stream.readLine());
}
//ui->statusBar->showMessage(line);
}
fileUpdate.close();
//lineUpdate1 = "Running";
QString lineUpdate2 = "Running";

if (lineUpdate1 == lineUpdate2){

//ui->statusBar->showMessage(tr("Está activo"));
ui->checkBox_wuauserv->setChecked(true);
}

else{

//ui->statusBar->showMessage(tr("Está inactivo"));
ui->checkBox_wuauserv->setChecked(false);
}
qDebug() << fileUpdate;
qDebug() << lineUpdate1;
qDebug() << lineUpdate2;

//fileUpdate.remove();

}

void MainWindow::on_actionTwitter_triggered()
{
QDesktopServices::openUrl(QUrl("https://www.twitter.com/winsyss_app", QUrl::TolerantMode));
ui->statusBar->showMessage(tr("Go to winsys twitter. Please wait."));
}

//##wuauserv

void MainWindow::on_checkBox_wuauserv_clicked(bool checked)
{
if (checked == false){
qDebug() << checked;
ui->statusBar->showMessage(tr("Running"));
system("sc config wuauserv start= disabled & net stop wuauserv");
ui->statusBar->showMessage(tr("Done. Now select another action"));
}

else if (checked == true){
qDebug() << checked;
ui->statusBar->showMessage(tr("Running"));
system("sc config wuauserv start= delayed-auto & net start wuauserv");
ui->statusBar->showMessage(tr("Done. Now select another action"));
}

checkServicesStatus();

}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::on_actionSeeReleases_triggered()
{
QDesktopServices::openUrl(QUrl("https://github.com/adgellida/winsys/releases", QUrl::TolerantMode));
ui->statusBar->showMessage(tr("For now launches to release page to update manually. Please wait."));
}

21 changes: 19 additions & 2 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private slots:
void on_installChocolateyButton_clicked();
void on_runDriverPackOnlineButton_clicked();
void on_updateAppButton_clicked();
void on_updateScriptsButton_clicked();
void on_actionTutorial_triggered();
void on_installChrisPCButton_clicked();
void on_runChrisPCButton_clicked();
Expand Down Expand Up @@ -98,7 +97,25 @@ private slots:
void on_installStopUpdates10Button_clicked();
void on_runStopUpdates10Button_clicked();
void checkServicesStatus();
void on_checkBox_wuauserv_clicked(bool checked);
void checkServiceWuauserv();
void checkServiceSysMain();
void checkServiceBits();
void checkServiceWSearch();
void on_checkBox_Wuauserv_clicked(bool checked);
void on_checkBox_SysMain_clicked(bool checked);
void on_checkBox_Bits_clicked(bool checked);
void on_checkBox_WSearch_clicked(bool checked);

void on_knowLicenceExpirationButton_2_clicked();

void on_knowLicenceExpirationButton_3_clicked();

void on_actionSeeReleases_triggered();

void on_actionUpdate_Scripts_triggered();

void on_actionUpdate_Program_triggered();

private:
Ui::MainWindow *ui;

Expand Down
Loading

0 comments on commit 3485b82

Please sign in to comment.