0

Below has the source code to the program Im writing... anyway I want to do this... I want to be able to include a file from the project in my executable... Example: If I put the program on a different computer, I want it to able to open a file that came with it... *sigh* not sure how to explain it well but Ill try again...

My program has a custom registry file I made... I have the entire program in a folder on my desktop but In order for the program to run the registry file, I have to give it the location of it... I dont want to do that, I want to have the .exe file include the registry file merged into it like a zip folder sorta and then to use the registry file when the .exe is ran. In other words, I dont want to point the program to the registry file on the desktop (I want the program Independant) so If I put it on a different computer, itll be able to use the file... I basically want all my included files in the .exe kinda like how an installer uses its own files inside itself and loads it onto a computer?

Im using Dev C++

#define _WIN32_WINNT	0x0500
#define _WIN32_IE		0x0500
#include <Windows.h>
#include <lm.h>
#include <assert.h>
#include <iostream>
#include <winuser.h>
#include <stdlib.h>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <shlobj.h>
#include <direct.h>
#include <windows.h>
#include <Shellapi.h>
#include <cstdlib>
#pragma comment(lib, "Netapi32.lib")

using namespace std;
int x,y,z;

int main(int argc, char *argv[])
{
    cout<<"Welcome to The Avast Patcher Beta... Some Parts are manually done! \n";
    Sleep(1000);
    cout<<"For CPU Speed Reasons, the browser will begin downloading a file in 20 Seconds!\n";
    cout<<"During the following Operations DO NOT TOUCH THE MOUSE/TRACKPAD!!\n";
    Sleep(5000);
    cout<<"Opening Default Browser and Downloading Torrent = Avast Pro AV 5.677\n";
    cout<<"Download Will begin 10 seconds after the browser has opened\n";
    cout<<"Dont touch the mouse!\n";
    Sleep(2000);

          HINSTANCE r = ShellExecute(NULL, "open", "Link", NULL, NULL, SW_SHOWNORMAL);
          Sleep(10000);
          keybd_event(VK_RETURN, 0, 0, 0);
          keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
          Sleep(7000);
          keybd_event(VK_RETURN, 0, 0, 0);
          keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
          Sleep(2000);                                           //Wait for program to start, Confirm download, Open with uTorrent.
          
          cout<<"AntiVirus Is downloading.. In the mean while uninstall any versions of Avast\n";
          cout<<"Do NOT restart the computer after uninstalling any previous versions!\n";
          
          system("AvastPatcher/RunOnce.reg");    //Add program to registry to Run Once on Reboot! THIS IS THE PART I WANNA REPLACE BECAUSE THE OTHER COMPUTER WILL NOT HAVE THIS FILE!
          
          cout<<"Press Enter ONLY when Avast is FINISHED DOWNLOADING!\n";
          cin.ignore();

          if (VK_RETURN)
          {
                                 system("shutdown -r");
                                 }    
    system("PAUSE");
    return EXIT_SUCCESS;
}

Edited by triumphost: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Ancient Dragon
0

when you copy your exe file to another computer copy the registry file to the same location.

Then you can progably change system("AvastPatcher/RunOnce.reg"); to just system("RunOnce.reg");

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.