How would you run an application off a network share so you can update application

batch-fileuacwindows 7

We have an internal desktop application which we have deployed to a network share. In that directory are subdirectories for each version, ie,
z:\Apps\ApplicationX\1.0
z:\Apps\ApplicationX\2.0
z:\Apps\ApplicationX\2.1

I would like to put a shortcut on the user desktops which point to the newest version of the application. My current solution is to put the current version into a directory called "z:\Apps\ApplicationX\Current", and put a shortcut on their desktop to the exe there.

The problem is that when they are running the application, I can't update the application because the file is locked.

I tried changing the shortcut to point to a batch file which copies the file locally and then runs it from there, but we're all on Windows 7, and UAC is causing issues copying the file to the C: drive where I would expect it to be installed.

I suppose I could copy the executable to the users home drive and run it from there, but I don't like the idea of having an executable in the users home drive. It also means that there are multiple copies of the application on the network, which I'm not a fan of.

I also thought that I might be able to have a shortcut to a shortcut and I would just update the shortcut, but that doesn't work either.

My current solution is to have a batch file which has the start command in it pointing to the current version, and a shortcut to that batch file.

Does anyone else have possible solutions?

Best Answer

My preferred method, two applications. The main app you already have. The second is a launcher/updater. Make a shortcut to the launcher, it checks a config setting (encrypted gibberish, xml, plain text, hard-coded directly into the launcher, whatever) for the path of the executable to launch then launches it. Once the main app is launched, the loader will terminate.

Whenever you get a new version, you update the config file of the launcher and future program launches will then open the new version.

It is the "boot loader" style process. Have a tiny assistance app that points to the full sized app. Clients launch the tiny app and it then directs them to the proper full app.

Bonus points if you have your launcher check hash fingerprints or signatures on the full sized apps to ensure no one gets creative and tries to link to another app from the launcher.