forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Add external ressource before closing my app

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 159
Location: FRANCE

PostPosted: Tue Jan 05, 2016 10:02 pm    Post subject: Add external ressource before closing my app Reply with quote

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
View user's profile Send private message Visit poster's website
stewcam
Newbie


Joined: 30 Sep 2006
Posts: 20

PostPosted: Wed Jan 06, 2016 12:28 am    Post subject: Adding an external resource to an exe file Reply with quote

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
View user's profile Send private message
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 159
Location: FRANCE

PostPosted: Wed Jan 06, 2016 12:32 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
stewcam
Newbie


Joined: 30 Sep 2006
Posts: 20

PostPosted: Wed Jan 06, 2016 1:52 am    Post subject: Reply with quote

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
View user's profile Send private message
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 159
Location: FRANCE

PostPosted: Wed Jan 06, 2016 2:48 am    Post subject: Reply with quote

I'm agree with you, but I don't want the file is stored on the pc. Wink
There's no way to integrate file in exe?
Back to top
View user's profile Send private message Visit poster's website
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Sun Jan 10, 2016 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
GregLand
Contributor
Contributor


Joined: 15 Jun 2004
Posts: 159
Location: FRANCE

PostPosted: Sun Jan 10, 2016 1:04 pm    Post subject: Reply with quote

It's ok.
I use this post... and optimize it for my use !
http://www.vdsworld.com/forum/viewtopic.php?p=35288#35288

Thumbs Up
Back to top
View user's profile Send private message Visit poster's website
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Jan 11, 2016 3:58 am    Post subject: Reply with quote

NICE! I missed that thread!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group