View previous topic :: View next topic |
Author |
Message |
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Tue Jan 05, 2016 10:02 pm Post subject: Add external ressource before closing my app |
|
|
Hello and Happy New Year 2016 to everyone .
I would like to integrate into a VDS program the ability to add an external resource when my program closes .
By compiling there is no problem
Code: | #resource add, binary, c:\file.txt ,file |
How can I do this while running my program ?
My program is a Portable Shareware and I would like to save in the exe a text file with the date of the last launch.
(I don't want to use registry or file stored on the PC)
LiquiCode has developed SelfScript (http://www.vdsworld.com/forum/viewtopic.php?t=5436) which integrate a text file in the app.
It's a function like this...
Could you help me please ?
Thanks a lot ! |
|
Back to top |
|
|
stewcam Newbie
Joined: 30 Sep 2006 Posts: 21
|
Posted: Wed Jan 06, 2016 12:28 am Post subject: Adding an external resource to an exe file |
|
|
I don't much care for this idea. An exe file that changes is likely to fall foul of antiviral software. Why not just store the information in a small ini or xml file in the same directory? |
|
Back to top |
|
|
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Wed Jan 06, 2016 12:32 am Post subject: |
|
|
Hi
Because if the file (xml, ini) is deleted, the shareware lost the date of first launch.
If I integrate it in registry or file on a pc, the shareware can be used on an other computer by the same user.
Thats why I would like to integrate the txt file in the exe... |
|
Back to top |
|
|
stewcam Newbie
Joined: 30 Sep 2006 Posts: 21
|
Posted: Wed Jan 06, 2016 1:52 am Post subject: |
|
|
If you want to save the date of last launch on a per computer basis for each user I would create the INI or XML file in the roaming folder under AppData (environment variable %appdata%). There is a risk that the file could be deleted, but the risk would be low. |
|
Back to top |
|
|
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
Posted: Wed Jan 06, 2016 2:48 am Post subject: |
|
|
I'm agree with you, but I don't want the file is stored on the pc.
There's no way to integrate file in exe? |
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Sun Jan 10, 2016 5:49 am Post subject: |
|
|
You can't have the exe modify itself while it is loaded in memory. The closest thing I can think to do is create a sfx with your exe and the txt file and use an external zip library to overwrite the text file on exit. |
|
Back to top |
|
|
GregLand Valued Contributor
Joined: 15 Jun 2004 Posts: 212 Location: FRANCE
|
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Mon Jan 11, 2016 3:58 am Post subject: |
|
|
NICE! I missed that thread! |
|
Back to top |
|
|
|