File tree 4 files changed +64
-21
lines changed
4 files changed +64
-21
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,12 @@ void uninstall()
134
134
get_app_path (updaterDir, 1023 );
135
135
sprintf (updaterPath, " %sautoUpdate.xml" , updaterDir);
136
136
137
+ QStringList files;
138
+ QStringList dirs;
139
+ QStringList cmds;
140
+
137
141
if (QFileInfo::exists (updaterPath))
138
142
{
139
- QStringList files;
140
- QStringList dirs;
141
- QStringList cmds;
142
-
143
143
readXML (files, dirs, cmds);
144
144
145
145
files.append (" autoUpdate.xml" );
@@ -160,6 +160,27 @@ void uninstall()
160
160
std::system (cmd.toStdString ().c_str ());
161
161
}
162
162
}
163
+
164
+ // Ugly fix for deleting updater dependencies on Windows
165
+ #ifdef WIN32
166
+ QString command = QString (" %1 -rm " ).arg (QApplication::applicationDirPath () + MVUTIL);
167
+
168
+ int runMvUtil = false ;
169
+ for (auto file : files)
170
+ {
171
+ if (QFileInfo::exists (file))
172
+ {
173
+ command = command + QString (" \" %1\" " ).arg (file);
174
+
175
+ runMvUtil = true ;
176
+ }
177
+ }
178
+
179
+ if (runMvUtil)
180
+ {
181
+ std::system (command.toStdString ().c_str ());
182
+ }
183
+ #endif
163
184
}
164
185
165
186
CMainWindow* getMainWindow ()
Original file line number Diff line number Diff line change 38
38
39
39
#include < iostream>
40
40
41
- #ifdef WIN32
42
- #define FEBIOBINARY " \\ febio4.exe"
43
- #define FBSBINARY " \\ FEBioStudio2.exe"
44
- #define FBSUPDATERBINARY " \\ FEBioStudioUpdater.exe"
45
- #define MVUTIL " \\ mvUtil.exe"
46
- #elif __APPLE__
47
- #define FEBIOBINARY " /febio4"
48
- #define FBSBINARY " /FEBioStudio"
49
- #define FBSUPDATERBINARY " /FEBioStudioUpdater"
50
- #define MVUTIL " /mvUtil"
51
- #else
52
- #define FEBIOBINARY " /febio4"
53
- #define FBSBINARY " /FEBioStudio"
54
- #define FBSUPDATERBINARY " /FEBioStudioUpdater"
55
- #define MVUTIL " /mvUtil"
56
- #endif
57
-
58
41
namespace Ui
59
42
{
60
43
class MyWizardPage : public QWizardPage
Original file line number Diff line number Diff line change 2
2
#include < QWizard>
3
3
#include < QSslError>
4
4
5
+ #ifdef WIN32
6
+ #define FEBIOBINARY " \\ febio4.exe"
7
+ #define FBSBINARY " \\ FEBioStudio2.exe"
8
+ #define FBSUPDATERBINARY " \\ FEBioStudioUpdater.exe"
9
+ #define MVUTIL " \\ mvUtil.exe"
10
+ #elif __APPLE__
11
+ #define FEBIOBINARY " /febio4"
12
+ #define FBSBINARY " /FEBioStudio"
13
+ #define FBSUPDATERBINARY " /FEBioStudioUpdater"
14
+ #define MVUTIL " /mvUtil"
15
+ #else
16
+ #define FEBIOBINARY " /febio4"
17
+ #define FBSBINARY " /FEBioStudio"
18
+ #define FBSUPDATERBINARY " /FEBioStudioUpdater"
19
+ #define MVUTIL " /mvUtil"
20
+ #endif
21
+
5
22
namespace Ui {
6
23
class CMainWindow ;
7
24
}
Original file line number Diff line number Diff line change @@ -12,6 +12,28 @@ int main(int argc, char* argv[])
12
12
{
13
13
if (argc < 3 ) return -1 ;
14
14
15
+ // Ugly fix for deleting updater dependencies on Windows
16
+ #ifdef WIN32
17
+ if (strcmp (argv[1 ], " -rm" ) == 0 )
18
+ {
19
+ for (int index = 2 ; index < argc; index ++)
20
+ {
21
+ int n = 0 ;
22
+ while (std::remove (argv[index ]) != 0 )
23
+ {
24
+ // If the file just doesn't exist, break
25
+ if (errno == ENOENT) break ;
26
+
27
+ _sleep (100 );
28
+ n++;
29
+ if (n > 10 ) break ;
30
+ }
31
+ }
32
+
33
+ return 0 ;
34
+ }
35
+ #endif
36
+
15
37
int start = 2 ;
16
38
bool dev = false ;
17
39
You can’t perform that action at this time.
0 commit comments