• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to automatically lunch my app when windows boots?

 
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what efforts i can make so that my java application automatically starts when windows(OS) start or boots ?
but solutions should be 100% programmatically , can any one has any idea about this ?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

naved momin wrote:what efforts i can make so that my java application automatically starts when windows(OS) start or boots ?



Sounds like you want it to be a Service. Google for java windows service, or look into Tanuki Service Wrapper.

but solutions should be 100% programmatically



If you mean what I think you mean by that, then it's not possible.
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:

but solutions should be 100% programmatically



If you mean what I think you mean by that, then it's not possible.



He could go and get a job for microsoft, and make everyone's computer start it at runtime
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:

Jeff Verdegan wrote:

but solutions should be 100% programmatically



If you mean what I think you mean by that, then it's not possible.



He could go and get a job for microsoft, and make everyone's computer start it at runtime



You'd think by now I'd know better than to use absolutes around a bunch of programmers.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alternatively, you can put a .bat file that starts the app in the AutoStart folder.
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or just put a symbolic link there.
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:Alternatively, you can put a .bat file that starts the app in the AutoStart folder.


yes that could be one solution but that require human intervention, i m finding solution programmatically
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

naved momin wrote:

Tim Moores wrote:Alternatively, you can put a .bat file that starts the app in the AutoStart folder.


yes that could be one solution but that require human intervention, i m finding solution programmatically



Define exactly what you mean by "programmatically." A .bat file is a programmatic approach, in my opinion.

If you mean what I think you mean--simply by what you put in your Java code--then it is not possible.
 
Ranch Hand
Posts: 99
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:

naved momin wrote:

Tim Moores wrote:Alternatively, you can put a .bat file that starts the app in the AutoStart folder.


yes that could be one solution but that require human intervention, i m finding solution programmatically



Define exactly what you mean by "programmatically." A .bat file is a programmatic approach, in my opinion.

If you mean what I think you mean--simply by what you put in your Java code--then it is not possible.





Hypothetically, you could have your Java program create the batch file in the startup directory. So only an initial run of the program would be required. Just my two cents.
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Philip Thamaravelil wrote:

Jeff Verdegan wrote:

naved momin wrote:

Tim Moores wrote:Alternatively, you can put a .bat file that starts the app in the AutoStart folder.


yes that could be one solution but that require human intervention, i m finding solution programmatically



Define exactly what you mean by "programmatically." A .bat file is a programmatic approach, in my opinion.

If you mean what I think you mean--simply by what you put in your Java code--then it is not possible.





Hypothetically, you could have your Java program create the batch file in the startup directory. So only an initial run of the program would be required. Just my two cents.



but would that be an installer step
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd say you should make your app a service, as Jeff suggested. You could then use for example MakeMSI to create Windows Installer file (.msi) and have the service registered by it.
 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can use Java Service Wrapper(32bit) or YAJSW(64bit). Old thread
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Philip Thamaravelil wrote:

Jeff Verdegan wrote:

naved momin wrote:

Tim Moores wrote:Alternatively, you can put a .bat file that starts the app in the AutoStart folder.


yes that could be one solution but that require human intervention, i m finding solution programmatically



Define exactly what you mean by "programmatically." A .bat file is a programmatic approach, in my opinion.

If you mean what I think you mean--simply by what you put in your Java code--then it is not possible.





Hypothetically, you could have your Java program create the batch file in the startup directory. So only an initial run of the program would be required. Just my two cents.


thats nice one ....good job...
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

naved momin wrote:

Philip Thamaravelil wrote:Hypothetically, you could have your Java program create the batch file in the startup directory. So only an initial run of the program would be required. Just my two cents.


thats nice one ....good job...


A shortcut (.lnk) pointing to javaw.exe with proper arguments might be better, you probably don't want to display the console to the user. Making it would be a bit harder, though. In either case, you need to obtain the right location of the startup folder from Windows. Its location is not present (as of Windows 7) in environment variables and the name depends (among other things) on the version and language of the system. For both of these task you'll probably have to call Windows system functions, should be doable with JNA.

However, you stated you wanted your program to run when Windows boot. This solution would run it when a user logs in. These are different things.

I've already mentioned MakeMSI. I was able to produce my first msi file in about two days, though I didn't know virtually anything about Windows Installer beforehand. MSI would easily allow you to create the shortcut in startup folder during the installation, without having to bother about the exact location of that folder. Also, chances are that a MSI package will function better on newer Windows versions, where User Account Control is in place.

If you go the other way, make sure to provide ways to cleanly uninstall your program again. You don't want to alienate your users.
 
Water! People swim in water! Even tiny ads swim in water:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic