Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to update my application on a network
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows '98
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01036848
Message ID:
01037018
Vues:
18
Hi Valter.

>Is there a solution to update my application on a network, without have to ask everybody to shut down, if they are running my application?


This is what I use :
Dim oFSO,oLocal,oRemote,cExe,cLocal,cRemote,oShell,cParm,BtnCode
cExe = "SeuExecutável.EXE"
cLocal = "C:\SeuDiretórioLocal\"
cRemote = "Z:\SeuDiretórioRemoto\"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
Set oRemote = oFSO.GetFile(cRemote & cExe)
If Not oFSO.FileExists(cLocal & cExe) then 
   oRemote.Copy cLocal
Else
   Set oLocal = oFSO.GetFile(cLocal & cExe)
   If oRemote.DateLastModified > oLocal.DateLastModified Then 
      BtnCode = oShell.Popup("Sistema será atualizado. Por favor, aguarde.", 3, "Atualização de Sistema", 0 + 64)
      oRemote.Copy cLocal
      BtnCode = oShell.Popup("Atualização Concluída.", 1, "Atualização de Sistema", 0 + 64)
   End If
End If
oShell.Run(cLocal & cExe)
Create a file like ATUALIZA.VBS and save it with the contents above.
Then, create your shortcut with it and the magic is done.

Hope that helps.

By the way, are you a CodeMine user ?

Abraços.
Ivan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform