• Post Reply Bookmark Topic Watch Topic
  • New Topic

Deployed java application and updates on Windows Vista and higher  RSS feed

 
Brandon McCulligh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello JavaRanch, long time lurker and finally a member here. I have a java application that I am getting ready to release to the public for Windows/OSX/Linux but I am running into problems related to permissions on Windows Vista and higher.

Basically the application installs to the standard c:\Program Files (configurable within the installer) which is great and my application data is stored in the users respective application data folder. Now here is the part I am struggling with. My application (like most) has the ability to check for updates and update itself. The update process performs the following steps;
1)Download update
2)Backup current application files (ones stored under c:\Program Files\....)
3)Unzip update over top of current application files
4)Clean up
5)Restart main application

There in lies the problem. In order to allow the update process to change its own files, I need to grant the JAR with administrative privileges; this seems crazy. Is there no way to install a java application on these operating systems that are allowed to change their own files by default? Obviously not installing the application into the "Program Files" directory works perfectly find - but most people install files into these directories (since that is their purpose).

I've been trying to figure out a good solution to this problem for well over a week now but alas I keep coming up empty handed. I am hoping someone here who has experience deploying on these OS' can shed some light on the topic.

Thank you.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Do the existing files really need to be altered? Can't the sell script that starts the app -or the Java main class if there is no shell script- not be made smarter to check for additional newer files in the same directory (possibly adhering to a particular naming scheme) and use those instead of the older ones?
 
Brandon McCulligh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes the old files need to be altered. If I fix a bug in the application, the corresponding JAR would need to be redeployed regardless if it is a lib jar or the executable jar itself. Changes will not always result in new files.

Furthermore, it doesn't actually matter whether it is new files or replacing old files, you are unable to change (add\edit) any file within the Program File's once they are put there by the install process, without elevated permissions which requires prompting the user to allow administrative permissions.


Maybe I am going about this all wrong? I cannot be the first one coming into this problem, there are millions of applications deployed to Windows.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are unable to change (add\edit) any file within the Program File's once they are put there by the install process, without elevated permissions which requires prompting the user to allow administrative permissions.

I see, I didn't realize that. I take it you have considered JNLP/JavaWebStart as a distribution mechanism and found it lacking? If nothing else, that solves the update problem rather easily.
 
Brandon McCulligh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct JWS isn't sufficient for my needs unfortunately.

Thanks for the suggestion though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!