开发者

How can I create a .msi file for a Java program ? (eclipse)

I have a java project which I'm hoping to package and sell. How can I create a .msi file which will install my program on other windows computers? If there are any tut开发者_运维问答orials, please direct me to them. I'm also using Eclipse if that has any bearing on how to create the .msi file.

Thanks


I've been using WiX extensively for creating MSI packages. It has quite a steep learning curve, but once you know what you're doing, it is very powerful. You said earlier that it needs Visual Studio installed, but I think it's just .NET 3.0, not the whole IDE.

I used this WiX tutorial when I got started, and it's got pretty much everything you need in there if you want to go down this route.

If you're after something simple, search for a tool called WixEdit on SourceForge. This has a GUI for building MSIs - it's not perfect, but pretty easy to use and produces professional results.

I'll repeat, WiX has a very steep learning curve, and if you're just after a simple way to package your application, NSIS might be easier; or, you could use the standard IExpress.exe tool built into Windows to create a self-extracting .exe (but they don't "feel" as good as an MSI).


There's nothing special about Java apps when it comes to creating MSI's other then you have to make sure you have a JVM/JRE installed just like you have to make sure the .NET framework is installed for .NET applications.

Your question is too broad to be able to answer. Implicit in your question is "What tool should I use?" and once that's decided "How do I make an MSI using this tool?"

For the first question, check out:

Windows Installer Authoring Tools for Developers


Use NSIS: http://nsis.sourceforge.net/Main_Page . It creates executable file that will do the same thing, and it is free.


If you specifically want to create an MSI package, and assuming you don't want to pay for something like InstallShield, look at Wix. http://wix.sourceforge.net/


I believe you want to look at Native Packaging, which according to this link was first introduced with JavaFX 2.2

https://netbeans.org/kb/docs/java/native_pkg.html

Since it seems to be official Netbeans docs, I imagine it is sanctioned by Oracle. Here is the counterpart for Mac for interested readers.

http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜