Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Manoj Patel
  Where is Manoj Patel?
 Pune
 India
 Manoj Patel
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Disabled Old Exe Files
Thread ID: 289166 Message ID: 289279 # Views: 39 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Security and Application Protection
Date: Thursday, December 30, 2010 10:03:20 AM         
   


> > Dear Experts,
> >
> > I have a designed a application for my customer. I always send updates with new complied Exe File. How Can I disabled all old Exe files when I send New Exe File.
> >
> > Regards
> > Imran
>
>
> Why would you need to do that?
>
> Anyway, here is a trick I think might work to some extent:
>
> local lcYourExe, lnFiles
> lcYourExe = "WHATEVER.EXE"
> * Get the number of files 
> lnFiles = Adir(aMyExes,"*.exe")
> If m.lnFiles > 0
>     Create Cursor junk (fld1 c(40), fld2 i, fld3 d, fld4 c(10), fld5 c(10))
>     * Transfer contents of array in cursor
>     Insert Into junk From Array aMyExes
>     Locate For Alltrim(fld1) = m.lcYourExe
>     If Found()
>         * compare date stamp with the date that is hardcoded inside the system
>        IF fld3 < date(2010,12,29)
>            Messagebox("System detected this is an old version, halting running of this version!")
>            Return(.f.)
>        Endif 
>     Endif
> Endif

>
> Every time you distribute a newer version, then change that hardcoded date with the date of your rebuilding. This won't affect older releases though as those does not have this. And really that protection can be broken if one wants to, but I guess your reason for this is so you are assured they are not running an old version that may still have bugs?
>
> On my end, I simply use loaders. What loaders does is every time an attempt to run my exe is made, the loader itself will look for the latest version and that is the one it will run. But older versions can still be run by simply clicking straight onto the specific exe and not using the loader. I don't mind, nobody knows it here on my side and the folder where those exes are are hidden from their prying eyes controlled by policies in the server. :-)
>
>
> http://www.junblogs.com/
> http://weblogs.foxite.com/sandstorm36/default.aspx
> http://www.coderisland.com/forum/viewforum.php?f=10


HI
Sorry Jun Tangunan but I want to change your coding due to when copy the same file name/same location then delete old file or overnight it
Generally we change exe name as

WHATEVER1.EXE
WHATEVER21.EXE
1WHATEVER.EXE
old WHATEVER.EXE
WHATEVER old.EXE
WHATEVER 30.12.2010.EXE

then how to search
so that just changes

===================
Locate For m.lcYourExe$Alltrim(fld1)
=============

local lcYourExe, lnFiles
lcYourExe = "WHATEVER.EXE"
* Get the number of files
lnFiles = Adir(aMyExes,"*.exe")
If m.lnFiles > 0
Create Cursor junk (fld1 c(40), fld2 i, fld3 d, fld4 c(10), fld5 c(10))
* Transfer contents of array in cursor
Insert Into junk From Array aMyExes
Locate For m.lcYourExe$Alltrim(fld1)
If Found()
* compare date stamp with the date that is hardcoded inside the system
IF fld3 < date(2010,12,29)
Messagebox("System detected this is an old version, halting running of this version!")
Return(.f.)
Endif
Endif
Endif



Thanks & Regards
Manoj Patel

ENTIRE THREAD

Disabled Old Exe Files Posted by Imran Khan @ 12/28/2010 9:24:44 PM
RE: Disabled Old Exe Files Posted by Jun Tangunan @ 12/29/2010 1:03:54 AM
RE: Disabled Old Exe Files Posted by Manoj Patel @ 12/30/2010 10:03:20 AM
RE: Disabled Old Exe Files Posted by Jun Tangunan @ 12/31/2010 12:15:34 AM