<div dir="ltr"><div><div><div>Thanks Joylon. Yip already have that flag set.It also enables the Exe on the server to be updated without having to get users to close down their versions running on client machines.<br></div>I think the APPData (common) will be a better location given I expect there may be multiple users on some machines.<br></div>I'll give that a poke and see howit works. Shouldnt be hard to replace the instances of (ExtractFilepath(Paramstr(0))) with a variable to APPData Common :-)<br><br></div>Thanks, guys.<br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 7:59 AM, Jolyon Smith <span dir="ltr"><<a href="mailto:jsmith@deltics.co.nz" target="_blank">jsmith@deltics.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>As David says, access the INI file on the client is a simple matter of deciding on a safe, reliable location (i.e. follow Windows guidelines for such configuration files). However for a configuration file I would suggest the use of AppData folder, rather than Documents.<br><br>Use SHGetFolderPath() (from SHFolder unit) using CSIDL_APPDATA (per user settings) or CSIDL_COMMON_APPDATA (shared/system wide). If you do decide to use the user documents folder then use CSIDL_PERSONAL instead.</div><div><br></div><div>NOTE: This is for supporting Windows versions pre-dating Vista. If you don't need to worry about that and can use Vista+ specific API's then you should use the newer Known Folders API instead (<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911(v=vs.85).aspx</a>).</div><div><br></div><div><br></div><div><br></div>Something else to bear in mind with this sort of approach is that if your user suffers even a micro-outage to the file server where the application EXE is located, this can result in a C0000006 exception if/when Windows tries to page the EXE during that outage. Your app is then unrecoverable from that point and requires a restart which may not otherwise be necessary once the outage is restored. The outages involved can be so brief that the user is otherwise unaware but can be catastrophic for applications running from net drives.<br><br>To avoid this you can mark the EXE with a PE header attribute that directs Windows to load the entire EXE into the workstation swapfile at launch, avoiding the need to load any further pages over the network. If you are using Delphi 7 or later (NOT XE7, just plain old 7) you can achieve this by adding a SETPEFLAGS directive to your application (typically in the DPR):<br><br><div>{$SETPEFLAGS IMAGE_FILE_NET_RUN_FROM_SWAP}</div><div><br></div><div>NOTE: You will need to add this AFTER the uses clause, and you will need the Windows unit in that uses clause since this directive sets attributes based on numeric values of constants and IMAGE_FILE_NET_RUN_FROM_SWAP is defined in the Windows unit.</div><br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 8 July 2015 at 21:58, Jeremy Coulter <span dir="ltr"><<a href="mailto:jscoulter@gmail.com" target="_blank">jscoulter@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi All.<div>I have an app that I will be running from a server location. However, I want the app. to read an ini file that is located in a folder on a client machine.</div><div>A Shortcut to the app on the server and the ini file will live in a folder on the client machine, but I cant work out how to get the app, when its run via the shortcut, to read the ini file on the client machine.</div><div>Anyone know how to go about doing this?</div><div>I have thought about dropping the INI and transferring the settings to a database with a row for each machine that connects, but before I get that carried away, I just wanted to see if someone had any ideas to do the above with the ini file.</div><div>The reason I want an ini for each computer is about settings. Not all machines have the same settings etc.</div><div><br></div><div>Thanks, Jeremy</div></div>
<br></div></div>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" rel="noreferrer" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" rel="noreferrer" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>