29 lines
907 B
C++
29 lines
907 B
C++
#include <iostream>
|
|
#include "registration_api.h"
|
|
#include "machine_code.h"
|
|
|
|
int main() {
|
|
std::cout << "--- Generating a valid License.data file for this machine ---" << std::endl;
|
|
|
|
const char* machine_code = GetMachineCode();
|
|
if (!machine_code || std::string(machine_code).empty()) {
|
|
std::cerr << "!! ERROR: Could not get machine code." << std::endl;
|
|
return 1;
|
|
}
|
|
std::cout << "Machine Code: " << machine_code << std::endl;
|
|
|
|
const char* future_date = "2099-12-31";
|
|
std::cout << "Expiration Date: " << future_date << std::endl;
|
|
|
|
int gen_result = GenerateLicenseFileFromCode(machine_code, future_date);
|
|
|
|
if (gen_result == 0) {
|
|
std::cout << ">> SUCCESS: License.data generated successfully." << std::endl;
|
|
} else {
|
|
std::cerr << ">> FAILURE: Failed to generate License.data." << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|