943,777 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 2526
  • C++ RSS
Oct 5th, 2006
0

How can I get a Program to Self Install itself in a given Directory?

Expand Post »
I am trying to make my program more easy to use and not have computer illiterate people struggle to install my program. My question is can a C++ program install ITSELF into another directory upon execution.
I want the program to run, but I also want it to make a backup copy of the same program in a certain directory.

Thanks a lot guys. If you guys want me to post my soure code of my current program I will, but I think this is a self explanatory question and doesn't relate to the context of the sour code.

Thanks a lot for taking the effort to respond.
Similar Threads
Reputation Points: 14
Solved Threads: 0
Junior Poster
Niklas is offline Offline
104 posts
since Sep 2005
Oct 5th, 2006
0

Re: How can I get a Program to Self Install itself in a given Directory?

This sounds somewhat suspicious (very useful for a malicious program) but I could be wrong...

I believe you could have the program open a file in the target directory, named as you wish the backup to be called. If the file exists, nothing's left to do. Otherwise you'd have to know where the original was, and copy the file to your target file. I think that would work fine, but I don't know if your OS will lock the original executable on the hard drive (doubtful, 'specially if you're just reading it).
Reputation Points: 683
Solved Threads: 53
Posting Virtuoso
Infarction is offline Offline
1,580 posts
since May 2006
Oct 5th, 2006
1

Re: How can I get a Program to Self Install itself in a given Directory?

Quote ...
I want the program to run, but I also want it to make a backup copy of the same program in a certain directory.
Be kind to the computer illiterate people and keep to conventions. A better method is to give people an installer that installs the program and then runs it after the installation is done. You can also put a shortcut in the same directory as the installer, or on the desktop.
Reputation Points: 53
Solved Threads: 6
Junior Poster in Training
Inanna is offline Offline
90 posts
since Sep 2006
Oct 5th, 2006
0

Re: How can I get a Program to Self Install itself in a given Directory?

Click to Expand / Collapse  Quote originally posted by Niklas ...
I am trying to make my program more easy to use and not have computer illiterate people struggle to install my program. My question is can a C++ program install ITSELF into another directory upon execution.
I want the program to run, but I also want it to make a backup copy of the same program in a certain directory.

Thanks a lot guys. If you guys want me to post my soure code of my current program I will, but I think this is a self explanatory question and doesn't relate to the context of the sour code.

Thanks a lot for taking the effort to respond.
Yes you can, for example if you were using windows you could use say,
mkdir() to magic up a directory, then you could copy the files in binary mode to that directory. Job done.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Reading in certain columns from CSV files into array C++
Next Thread in C++ Forum Timeline: Improve performance ISAPI





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC