-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmain.cpp
36 lines (28 loc) · 1.24 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <QProcess>
#include <iostream>
#include <QStringlist>
#include "updater.h"
using namespace std;
float currentVersion = 0.01;
void CheckVersion() {
Updater u;
u.Initialize();
if (!u.CheckVersionOK(currentVersion)) {
qDebug() << "New version of Turbo Rascal Syntax Error (" + QString::number(u.m_newVersion) +") released, downloading...";
u.FetchNewVersion();
//QProcess::startDetached("bin/7z.exe", QStringList() << "x"<<"trse_win.zip" <<"-aoa" << "-O..\\", "." );
/* if (!QFile::exists("newVersion.cmd")) {
QProcess p;
cout << "Error : New Bootstrapper version. Trying to extract newVersion.cmd. If this doesn't work, just unpack the zip file manually.. hopefully works in the next version" << endl;
p.execute("bin/7z.exe", QStringList() << "x"<<"trse_win.zip" <<"-aoa" << "-O..\\"<< "newVersion.cmd");
}*/
}
else qDebug() << "No new version. Continuing.";
}
int main(int argc, char *argv[])
{
cout << "This is TRSE updater currently version " << QString::number(currentVersion).toStdString() << endl;
CheckVersion();
// QProcess::startDetached("bin/trse.exe",QStringList(),"bin/");
QProcess::startDetached("start.cmd",QStringList(),".");
}