How to create an installer???



  • Hello everyone,

    My tool is now almost finished and I want to create an installer for it. So people could just double click the installed pick their destination and then have it installed.

    Does Qt creator have this functionality built in ? And if so how would i do it?

    Thank you =]



  • AFAIK there's no built in utility for that task. I think it's somewhat tricky to write an installer in Qt itself as it would require to do a static build, because if you do dynamic linking you'd need to deploy the Qt libraries required by your installer (like QtGui and QtCore at least) with the installer binary.

    If you've got the according licence to do static linking I'd be possible to write your own installer with Qt. You could use "QWizard":http://qt-project.org/doc/qt-4.8/qwizard.html to create a wizard based installer and copy the files (you could include them by using the resource system) to the according locations. Finding those locations will prove a bit tricky as it heavily depends on the operating system you're deploying to.

    If you do not have the right licence for that task and only may use dynamic linking... I would use one of the many tools out there that will create installer applications for windows and deploy according packages for Linux environments (.deb or .rpm etc.).

    I might be a bit wrong regarding that licence stuff as I am not that familiar with commercial Qt licences :)



  • I am guessing windows here so my answer is platform dependent .

    There is some free software that can help you create the installer you need. But first you must decide which dll's you need to distribute with your application. When you are clear about it you can try many programs. I have tried two of them both of which are free. "Inno Setup":http://www.jrsoftware.org/isinfo.php is the one and "nsis":http://nsis.sourceforge.net/Main_Page the other. Both of them are scriptable but the easiest to use for a Beginner in my opinion is Inno thanks to its very simple yet powerful enough wizard.



  • My recommendation for Windows would be NSIS too!

    But as the development of the original NSIS seems to have slowed down and still doesn't support Unicode, be sure to get the Unicode Variant of NSIS from here:
    http://code.google.com/p/unsis/downloads/list?can=2&q=&sort=-uploaded&



  • Thanks guys, Well i already have all my files DDL's and everything i need to run the program on it's own.

    What i should have said i just want a way to install my files and folders from a single installer.exe file =]

    But the links your provided seems will do the job, i'll try them out bit later and will let you know how it all went.

    Big thanks!



  • Then NSIS is perfectly suitable for you (maybe Inno too, can't say much about Inno).

    Of course much more "sophisticated" installers can be created with NSIS, but creating something that basically is a "self-extracting EXE" can be done too. Should be straight forward. It can look like:
    @; The name of the installer
    Name "My Superduper Application"

    ; The file to write
    OutFile "Installer.exe"

    ; The default installation directory
    InstallDir "$PROGRAMFILES\My Company\My Application"

    ; Request "Admin" privileges for Windows Vista/Win7 (required!)
    RequestExecutionLevel user

    ;--------------------------------

    ; Pages

    Page directory ; 1st page: Let user choose target directory
    Page instfiles ; 2nd page: Install the files

    ; COULD ADD SOMETHING LIKE A LICENSE PAGE HERE

    ;--------------------------------

    ; The stuff to install
    Section "The Application"

    ; Set output path to the installation directory.
    SetOutPath "$INSTDIR"

    ; Files to be extracted to the installation directory.
    File "MainApp.exe"
    File "SomeRequiredDLL.dll"
    File "AnotherDLL.dll"

    ; ADD MORE FILES HERE ...

    SectionEnd ; end the section

    ;--------------------------------

    ; Optional section, create Startmenu entries
    Section "Start Menu Shortcuts"

    ; Create directory in Startmenu
    CreateDirectory "$SMPROGRAMS\My Application"

    ; Create the Shortcuts:
    CreateShortCut "$SMPROGRAMS\My Application\Launch Application.lnk" "$INSTDIR\MainApp.exe"

    SectionEnd ; end the section@

    Just save the above code to "installer.nsi" and compile it with:

    @makensis.exe "C:\Path to my stuff\installer.nsi"@



  • Another vote for NSIS!



  • I like InnoSetup - to give that a vote! :)



  • Don't waste a time on scripting - use "Actual Installer":http://actualinstaller.com



  • Installer? No problem.
    @tar -czf installer.tar.gz *@
    There you go.

    // EDIT: vote for innosetup, but only if your application really needs an installer. There are too many Microsoft® Windows® applications that just use an installer to look professional. That's unprofessional.



  • If you need to provide support for multiple platforms you may want to check out "InstallBuilder For Qt":http://installbuilder.bitrock.com

    It allows you to configure complex installation logic so you can have the same wizard-like UI across different target platforms. It also provides unattended and text modes as well as the ability to generate .deb and .rpm packages. We offer free licenses to open source projects.



  • [quote author="ridruejo" date="1345639746"]If you need to provide support for multiple platforms you may want to check out "InstallBuilder For Qt":http://installbuilder.bitrock.com[/quote]
    Wow, 2000$ for a cross-platform install builder? I should start in that market, too ;D

    [quote]We offer free licenses to open source projects.[/quote]
    Now that is really great!



  • Did somebody try "Qt Installer Framework":https://qt.gitorious.org/qt-labs/installer-framework ?



  • [quote author="DerManu" date="1345660060"]
    Wow, 2000$ for a cross-platform install builder? I should start in that market, too ;D
    [/quote]

    Selling development tools is certainly a tough market, that's for sure. Sometimes I wonder if we should have started a social-commerce mobile app or something along those lines :) Most of our customers are in the Enterprise and our main competitor is InstallAnywhere, which typically goes between $6.000 and $10.000, so we are actually much cheaper compare to them. We also provide top-notch support directly from the developers, instead of outsourcing it. Having said that, we have customers outside the enterprise and offer significant small business and academic discounts, so please contact us if that is your case.



  • Very powerful and also a free license available: "Advanced Installer":http://www.advancedinstaller.com


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.