-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (22 loc) · 1021 Bytes
/
main.cpp
File metadata and controls
30 lines (22 loc) · 1021 Bytes
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
#include <iostream>
#include "Updater/Updater.h" // Update the path as needed
int main() {
const std::string currentVersion = "1.0";
std::cout << "Starting application (v" << currentVersion << ")...\n";
if (Updated(currentVersion)) {
// Executed right before the application exits for an update
std::cout << "Update found and applied!\n";
std::cout << "Restarting application with new version...\n";
// You can do cleanup, save state, or log here if needed
return 0; // The application will be restarted via batch script
} else {
// No update found — continue as normal
std::cout << "No update needed, continuing with normal execution...\n";
std::cout << "Program running normally...\n";
// Your regular application logic here
// Example:
std::cout << "Hello from version " << currentVersion << "!\n";
std::cin.get(); // Pause for demonstration
}
return 0;
}