Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - MEGAMIND

#1
VCMP UPDATER URL DOWNLOADER a tool that downloads and installs the build version of vcmp, this tool was made due to an unexpected behaviour going on with vcmp official browser / or networks


Its virus free 0 viruses marked by Virustotal



#include <iostream>
#include <string>
#include <vector>
#include <windows.h>
#include <urlmon.h>
#include <shlobj.h>
#include <fstream>
#include <sstream>
#include <direct.h>

#pragma comment(lib, "urlmon.lib")
#pragma comment(lib, "shell32.lib")

struct VersionInfo {
    std::string version;
    std::string filename;
    std::string build;
};

class VCMPDownloader {
private:
    std::string baseUrl = "https://u04.thijn.ovh";
    std::string baseTargetPath;

public:
    VCMPDownloader() {
        // Get the base target path
        char appDataPath[MAX_PATH];
        if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, appDataPath))) {
            baseTargetPath = std::string(appDataPath) + "\\Vice City Multiplayer\\";
        }
        else {
            baseTargetPath = "C:\\Users\\%username%\\AppData\\Local\\Vice City Multiplayer\\";
        }
    }

    bool directoryExists(const std::string& path) {
        DWORD attrib = GetFileAttributesA(path.c_str());
        return (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY));
    }

    bool createDirectory(const std::string& path) {
        // Create all directories in the path
        std::string current;
        for (size_t i = 0; i < path.length(); i++) {
            current += path[i];
            if (path[i] == '\\' || i == path.length() - 1) {
                if (!directoryExists(current) && current != "C:" && current != "C:\\") {
                    if (!CreateDirectoryA(current.c_str(), NULL)) {
                        if (GetLastError() != ERROR_ALREADY_EXISTS) {
                            return false;
                        }
                    }
                }
            }
        }
        return true;
    }

    std::string downloadPage(const std::string& url) {
        std::string tempFile = "temp_page.html";

        // Download the HTML page
        std::cout << "Downloading version information..." << std::endl;
        if (URLDownloadToFileA(NULL, url.c_str(), tempFile.c_str(), 0, NULL) != S_OK) {
            std::cout << "Failed to download page from: " << url << std::endl;
            return "";
        }

        // Read the downloaded file
        std::ifstream file(tempFile);
        if (!file.is_open()) {
            std::cout << "Failed to open temporary file" << std::endl;
            return "";
        }

        std::stringstream buffer;
        buffer << file.rdbuf();
        file.close();

        // Delete temporary file
        DeleteFileA(tempFile.c_str());

        return buffer.str();
    }

    std::vector<VersionInfo> parseVersions(const std::string& html) {
        std::vector<VersionInfo> versions;
        size_t pos = 0;

        while ((pos = html.find("Version <a href=\"/files/", pos)) != std::string::npos) {
            // Extract filename
            size_t href_start = html.find("href=\"", pos) + 6;
            size_t href_end = html.find("\"", href_start);
            if (href_end == std::string::npos) break;

            std::string filepath = html.substr(href_start, href_end - href_start);

            // Extract version
            size_t version_start = html.find(">", href_end) + 1;
            size_t version_end = html.find("<", version_start);
            if (version_end == std::string::npos) break;

            std::string version = html.substr(version_start, version_end - version_start);

            // Extract build from filename
            std::string filename = filepath.substr(filepath.find_last_of("/") + 1);
            std::string build = filename.substr(6, 8); // Extract build ID

            versions.push_back({ version, filename, build });

            pos = version_end;
        }

        return versions;
    }

    bool downloadFile(const std::string& filename) {
        std::string url = baseUrl + "/files/" + filename;
        std::string localPath = filename;

        std::cout << "Downloading: " << filename << std::endl;

        if (URLDownloadToFileA(NULL, url.c_str(), localPath.c_str(), 0, NULL) == S_OK) {
            std::cout << "Download completed: " << filename << std::endl;
            return true;
        }
        else {
            std::cout << "Download failed: " << filename << std::endl;
            return false;
        }
    }

    std::string cleanVersionName(const std::string& version) {
        std::string clean = version;
        // Replace characters that are not valid in folder names
        for (size_t i = 0; i < clean.length(); i++) {
            if (clean[i] == ':' || clean[i] == '\\' || clean[i] == '/' ||
                clean[i] == '*' || clean[i] == '?' || clean[i] == '"' ||
                clean[i] == '<' || clean[i] == '>' || clean[i] == '|') {
                clean[i] = '_';
            }
        }
        return clean;
    }

    bool extractWithWinRAR(const std::string& archivePath, const std::string& version) {
        // Common WinRAR installation paths
        const char* winRARPaths[] = {
            "C:\\Program Files\\WinRAR\\WinRAR.exe",
            "C:\\Program Files (x86)\\WinRAR\\WinRAR.exe",
            "C:\\Program Files\\WinRAR\\Rar.exe",
            "C:\\Program Files (x86)\\WinRAR\\Rar.exe"
        };

        std::string winRARExe;
        bool foundWinRAR = false;

        // Find WinRAR installation
        for (int i = 0; i < 4; i++) {
            if (GetFileAttributesA(winRARPaths[i]) != INVALID_FILE_ATTRIBUTES) {
                winRARExe = winRARPaths[i];
                foundWinRAR = true;
                std::cout << "Found WinRAR at: " << winRARExe << std::endl;
                break;
            }
        }

        if (!foundWinRAR) {
            std::cout << "WinRAR not found in standard locations!" << std::endl;
            return false;
        }

        // Create version-specific folder
        std::string cleanVersion = cleanVersionName(version);
        std::string versionTargetPath = baseTargetPath + cleanVersion + "\\";

        // Create the version directory
        if (!directoryExists(versionTargetPath)) {
            std::cout << "Creating version directory: " << versionTargetPath << std::endl;
            if (!createDirectory(versionTargetPath)) {
                std::cout << "Failed to create version directory!" << std::endl;
                return false;
            }
        }

        // Build WinRAR command
        std::string command = "\"" + winRARExe + "\" x -y -s -ibck \"" + archivePath + "\" \"" + versionTargetPath + "\"";

        std::cout << "Extracting to version folder: " << versionTargetPath << std::endl;
        std::cout << "Command: " << command << std::endl;

        STARTUPINFOA si = { sizeof(si) };
        PROCESS_INFORMATION pi;
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;

        if (CreateProcessA(NULL, (LPSTR)command.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
            WaitForSingleObject(pi.hProcess, INFINITE);

            DWORD exitCode;
            GetExitCodeProcess(pi.hProcess, &exitCode);

            CloseHandle(pi.hProcess);
            CloseHandle(pi.hThread);

            if (exitCode == 0) {
                std::cout << "WinRAR extraction successful to version folder!" << std::endl;
                return true;
            }
            else {
                std::cout << "WinRAR extraction failed with exit code: " << exitCode << std::endl;
            }
        }
        else {
            std::cout << "Failed to start WinRAR process!" << std::endl;
        }

        return false;
    }

    bool extract7z(const std::string& archivePath, const std::string& version) {
        // Create version-specific folder
        std::string cleanVersion = cleanVersionName(version);
        std::string versionTargetPath = baseTargetPath + cleanVersion + "\\";

        // Create the version directory
        if (!directoryExists(versionTargetPath)) {
            std::cout << "Creating version directory: " << versionTargetPath << std::endl;
            if (!createDirectory(versionTargetPath)) {
                std::cout << "Failed to create version directory!" << std::endl;
                return false;
            }
        }

        // Use 7z.exe to extract
        std::string command = "7z x \"" + archivePath + "\" -o\"" + versionTargetPath + "\" -y";

        std::cout << "Extracting with 7-Zip to version folder: " << versionTargetPath << std::endl;

        STARTUPINFOA si = { sizeof(si) };
        PROCESS_INFORMATION pi;
        si.dwFlags = STARTF_USESHOWWINDOW;
        si.wShowWindow = SW_HIDE;

        if (CreateProcessA(NULL, (LPSTR)command.c_str(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
            WaitForSingleObject(pi.hProcess, INFINITE);

            DWORD exitCode;
            GetExitCodeProcess(pi.hProcess, &exitCode);

            CloseHandle(pi.hProcess);
            CloseHandle(pi.hThread);

            if (exitCode == 0) {
                std::cout << "7-Zip extraction successful to version folder!" << std::endl;
                return true;
            }
        }

        std::cout << "7-Zip extraction failed!" << std::endl;
        return false;
    }

    void showVersions(const std::vector<VersionInfo>& versions) {
        std::cout << "\nAvailable VC:MP Versions:\n";
        std::cout << "==========================\n";

        for (size_t i = 0; i < versions.size(); i++) {
            std::cout << i + 1 << ". " << versions[i].version << " (Build: " << versions[i].build << ")\n";
        }
    }

    void run() {
        std::cout << "VC:MP Downloader and Installer\n";
        std::cout << "==============================\n\n";

        // Create base target directory if it doesn't exist
        if (!directoryExists(baseTargetPath)) {
            std::cout << "Creating base directory: " << baseTargetPath << std::endl;
            if (!createDirectory(baseTargetPath)) {
                std::cout << "Failed to create base directory: " << baseTargetPath << std::endl;
                return;
            }
        }

        // Download and parse the page
        std::string html = downloadPage(baseUrl);

        if (html.empty()) {
            std::cout << "Failed to fetch version information!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        std::vector<VersionInfo> versions = parseVersions(html);

        if (versions.empty()) {
            std::cout << "No versions found!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        // Show available versions
        showVersions(versions);

        // Let user choose version
        int choice;
        std::cout << "\nEnter the number of the version to download (1-" << versions.size() << "): ";
        std::cin >> choice;

        if (choice < 1 || choice > versions.size()) {
            std::cout << "Invalid choice!" << std::endl;
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        VersionInfo selected = versions[choice - 1];

        std::cout << "\nSelected: " << selected.version << std::endl;
        std::cout << "File: " << selected.filename << std::endl;
        std::cout << "Base Path: " << baseTargetPath << std::endl;

        // Download the file
        if (!downloadFile(selected.filename)) {
            std::cout << "Press Enter to exit...";
            std::cin.ignore();
            std::cin.get();
            return;
        }

        // Extract the file to version-specific folder
        std::cout << "\nExtracting files to version folder..." << std::endl;

        bool extracted = false;

        // Try WinRAR first
        extracted = extractWithWinRAR(selected.filename, selected.version);

        // If WinRAR fails, try 7-Zip
        if (!extracted) {
            std::cout << "Trying 7-Zip extraction..." << std::endl;
            extracted = extract7z(selected.filename, selected.version);
        }

        // Clean up downloaded archive
        if (extracted) {
            std::cout << "Cleaning up..." << std::endl;
            if (DeleteFileA(selected.filename.c_str())) {
                std::cout << "Temporary file removed." << std::endl;
            }
            std::cout << "Installation completed successfully!" << std::endl;
            std::cout << "Version installed to: " << baseTargetPath << cleanVersionName(selected.version) << "\\" << std::endl;
        }
        else {
            std::cout << "Installation failed! Make sure WinRAR or 7-Zip is installed." << std::endl;
            std::cout << "Downloaded file kept as: " << selected.filename << std::endl;
        }

        std::cout << "Press Enter to exit...";
        std::cin.ignore();
        std::cin.get();
    }
};

int main() {
    VCMPDownloader downloader;
    downloader.run();
    return 0;
}

Github repo


How to use it?

Note:
Requires winrar or 7z
#2
Update:
VCMP Browser for win 7 updated due to a bug that caused the theme switcher to remain at user custom theme option, its now resolved and all other themes can be applied normaly

The issue was noticed by Khattak$ response...! on discord

Users on win 7 build of the browser are required to Re-Download from Website
#3

🎉 Big News! 🎉

🚀 MEGAMIND's VCMP Browser is now officially available on the Microsoft Store!

Experience the fastest, smoothest way to browse, connect, and play VC:MP — now easier than ever to install and update through the Microsoft Store.

🟦 Download now and enjoy seamless access, automatic updates, and a modern interface built for the community!

👉 Get it on Microsoft Store


Thank you to everyone who supported the project
#4
Update:
VCMP Browser for win 7 updater url bug fixed, The updater url was dead due to host transfer issue.. its now resolved

Note:
It is to be re-cleared again that browser doesnt rely on official vcmp browser at all..!

The issue was noticed due to Kyber7 response...! on discord

Users on win 7 build of the browser are required to Re-Download from Website
#5




Features
  • Added custom UI css (users can desing there own ui now)

Note:
Requires css coding knowledge to make your own ui...
Devs can do it easily ofc  ;)
To modify the custom css ui file, you have to navigate to thisC:\Users\hp\AppData\Local\VCMP_Browser\app-1.7.2\resources\extraResources\file\style.css path and edit it..!

where app-1.7.2 is app version....

In future updates ill try to make it happen in browser automatically instead of manualy modifying the file, though you can make ur master piece and share
with your freinds too..!

The best one who shows the master piece can get a chance to get added to browser officialy... with the default themes

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update

 




#6


Features
  • Uninstaller bug fixed (due to previous update)

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update
#7




Features
  • Added Favourites / Bookmark system

Note
Each hostname or row will contain a star (by default white -> Transparent in terms) when clicked, it turns yellow, means its in your favourities list.. When ever you open the browser your favourite servers will show pined at first before everyother server..!

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update

#8
[Announcement] VC:MP Forum App - Self Update Added
you wont need to check playstore anymore
The app silently updates in background..!
#9
[Announcement] VC:MP Forum App - Notifications Issue Resolved

Dear VC:MP Community,

We experienced an issue where notifications in the VC:MP Forum App stopped working for the past few months. Our team has identified and resolved the problem (had host issues), and notifications should now be functioning as expected.


Thank you for your patience and support!
#10


Features
  • Fixed voip (server issues fixed)
  • Chat system (server issues fixed)
  • Version Display (server issues fixed)

Update your browsers to stable release (Recomended)

Note: Windows 7 users can download it from website manually

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update
#11


Features
  • Stable Release

Update your browsers to stable release (Recomended)

Note: Both Latest Windows & Windows 7 users can download it from website manually, as the host has been moved to a new location, due to which old browser my not be able to update them selves automatically, Kindly re-download the browser so that new updates start to happen automatically..!

Thanks for your patience that have waited for so long..

Those who have the browser already installed will get a update automatically, those who are new to this browser can download and install the latest update
#12
Quote from: habi2 on Aug 10, 2025, 12:38 PM1.6.7

besides, one key (=) in keyboard stuck when browser was open.
Browser with most of my services are offline... thats why you are getting that status..

Will revive the browser in near future..! also the key isnt stuck its changeable..! its used for vocie input api in which u can talk to your freinds via voice.. like voip same as samp
#13
https://rtclan.vcmp.net/index.php?topic=290 <- try this currently the only one providing.. as mine is offline from few years now
#14
whats the server ip and port?, also try changing masterlist urls from thijn to official or official to thijn

if still not then use the connection checker https://thijn.minelord.com/vcmp/checker/
#15
General Discussion / Re: Please help me
Jul 24, 2025, 11:36 AM
Quote from: Toto02 on Jul 24, 2025, 09:40 AMWhen i try to connect to GTA vice city mp the pc shows me the message in the image i attached. Can you help me?
Download & Install