schlitzy Posted September 12, 2006 Share Posted September 12, 2006 I am working on a programm which will be checking an internal database. It is supposed to be started every day with some actions differing slightly. I would like to leave the programm on the different computers as it is and simply update a seperate file, which the .Exe file is supposed to be reading from (it would contain some variables and user defined functions). That way, the users do not have to have administrative privileges to get the new update. I was thinking about using the #include, but with that, once the file is in, it is in. So: 1.) How do I include a file at every startup of the .exe? 2.) Is there a way to auto-update this file at every startup of the programm? The file would ideally be on a server and replaces itself on the local pc if there is an update available. Thanks a lot s Link to comment Share on other sites More sharing options...
dandymcgee Posted September 12, 2006 Share Posted September 12, 2006 #include should work fine, as long as you don't change the external file's name when you update it. Just add #include <UPDATE FILE HERE> and whenver you update the included file it will use the new stuff in it. As for auto-updating the other file when the exe is started just have some function BEFORE the #include, and it will update before it is included. Shouldn't be too awfully hard? Hopefully this helped? - Dan [Website] Link to comment Share on other sites More sharing options...
McGod Posted September 12, 2006 Share Posted September 12, 2006 #include should work fine, as long as you don't change the external file's name when you update it. Just add #include <UPDATE FILE HERE> and whenver you update the included file it will use the new stuff in it. As for auto-updating the other file when the exe is started just have some function BEFORE the #include, and it will update before it is included. Shouldn't be too awfully hard? Hopefully this helped?#include will grab the stuff upon compile, so if he compiles it the thing wont work.As for downloading, use something like Updates.ini, Use InetGet to download it then check to see if the version in Updates.ini is the same as the version of the client. If the Updates.ini is newer, you would then read the filename from the ini the use another INetGet to grab it. [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 12, 2006 Moderators Share Posted September 12, 2006 FileInstall() + InetGet() (as Chip suggested) or even FTP.au3 functions may be an option. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
sohfeyr Posted September 13, 2006 Share Posted September 13, 2006 (edited) Why do you have to run it compiled? Something I've done before is have the au3 files with the code in them in a folder, but then have a compiled executable with one line in it: RunWait(@AutoItExe & " /AutoIt3ExecuteScript " & ScriptDir & "\src\myFile.au3") With judicious use of this technique, registry calls, and some shrewd choices in terms of Run() vs RunWait(), I've been able to set up a subsystem that starts to look a lot like multithreading (as long as nobody opens Task Manager) Edited September 13, 2006 by sohfeyr Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
schlitzy Posted September 13, 2006 Author Share Posted September 13, 2006 For the update. FileInstall () and InetGet() really should work fine. Thanks a lot for that idea. Should have thought of that... However, to include the file at every startup of the programm, I am not quite convinced by sohfeyr's solution, since I would have more files floating around, a greater CPU usage, an additional process and a whole lot of room for error. Also, the users could possibly retrieve passwords from the uncompiled files. I had another idea: Is it possible to read from a file (.ini, .dat, .txt, whatever) without having to open it in a seperate window? The Programm would start several times a day. Therefore, I cannot have open windows with code floating around... Thanks for your help and sorry for my late replies, I am currently travelling and not constantly hooked up to the internet. s Link to comment Share on other sites More sharing options...
dandymcgee Posted September 13, 2006 Share Posted September 13, 2006 as far as I know when you read ini or such, the file is not actually "opened" in a separate window that you can see. Maybe it's opened in a hidden window, I'm not sure, but I think it just reads the information from the file. Just the simple functions IniRead() and IniWrite() should do the job. The information stored in them is easy to view by whom ever may be using the computer though, so watch out what you store in them. - Dan [Website] Link to comment Share on other sites More sharing options...
schlitzy Posted September 14, 2006 Author Share Posted September 14, 2006 Works great. Thanks. I am updating the .ini from the server now and read data directly from the file. Thanks a bunch, guys! s Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now