1

I have an internal intranet application as a exe file (win32, written in Delphi).

I regularly update it with new features and patches.

Many people are accessing the same exe (using it with remote desktop).

In Windows Server 2003 to replace the file I just needed to:

rename the old file, copy the new file.

This is not possible in 2008 anymore since because of same caching the new file doesn't work. It runs but then there are problems (probably linked to the way Delphi uses the exe resources). The only way is to close all the users sessions and replace the file.

May you suggest a method that works? Simple if possible? Is it possible to disable this caching? Or any other trick that allows me to replace a file (without changing the full path).

Joel Coel
  • 12,910
  • 13
  • 61
  • 99
user193655
  • 253
  • 1
  • 5
  • 17
  • possible duplicate of [Bad behaviour of native win32 application when replacing the exe with some users using it](http://serverfault.com/questions/187328/bad-behaviour-of-native-win32-application-when-replacing-the-exe-with-some-users) – Chris S May 10 '11 at 15:17
  • Yes it is a duplicate but I was hoping for some other suggestion. By in win2003 i achieved the correct result, and it was saisfing for me. – user193655 May 10 '11 at 15:21
  • 5
    And now Windows is enforcing proper procedure for great justice. – Chris S May 10 '11 at 15:24

3 Answers3

6

Schedule a maintenance window and replace the file when there are no users working with it. Just because Server 2003 allowed you to get away with doing something the wrong way, doesn't mean 2008 should.

The part where you mention this:

The only way is to close all the users sessions and replace the file.

is the right way to go about it.

DanBig
  • 11,393
  • 1
  • 28
  • 53
4

As an alternative, you could create a new launcher that never changes. It will read which version of the executable to start, and start the updated version.

So if the end-user shortcuts point at filename.exe, then that is what you would name your launcher, the launcher might read the file filename.versions, then execute filename.version.exe.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • I did launcher and it works great, launcher simply reads from ini file the path of the exe to run so I use "oddfilenames" like "Application20130112_v1.exe" and I rule. I just need to write in the ini file the correct path. – user193655 Jan 09 '13 at 08:43
0

I guess if you use UPX compressor, you'll be able to remove the executable. Once the .exe is decompressed on the ram.

Valmir
  • 101