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

Reply

Join Date: Sep 2005
Posts: 102
Reputation: Niklas is an unknown quantity at this point 
Solved Threads: 0
Niklas's Avatar
Niklas Niklas is offline Offline
Junior Poster

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

 
0
  #1
Oct 5th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,582
Reputation: Infarction has a spectacular aura about Infarction has a spectacular aura about Infarction has a spectacular aura about 
Solved Threads: 52
Infarction's Avatar
Infarction Infarction is offline Offline
Battle Programmer

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

 
0
  #2
Oct 5th, 2006
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).
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 90
Reputation: Inanna is on a distinguished road 
Solved Threads: 6
Inanna's Avatar
Inanna Inanna is offline Offline
Junior Poster in Training

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

 
1
  #3
Oct 5th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 376
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

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

 
0
  #4
Oct 5th, 2006
Originally Posted by Niklas View 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.
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.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC