Questions about making an install wizard for windows.



  • I decided to make my app available also for Windows and i am a little bit newbie on what i have to do at the install wizard. I will probably use Inno Setup as a lot of people recommend. Some questions.

    1. In order my app to run i need these files:
      @Directory of C:\Program Files (x86)\Wallch

    04/22/2013 18:03 22,378,434 icudt51.dll
    04/22/2013 18:03 3,369,922 icuin51.dll
    04/22/2013 18:03 1,978,690 icuuc51.dll
    04/17/2013 20:18 544,817 libgcc_s_dw2-1.dll
    04/17/2013 20:19 989,805 libstdc++-6.dll
    04/17/2013 19:26 73,901 libwinpthread-1.dll
    12/15/2013 13:30 4,604,928 Qt5Core.dll
    12/08/2013 20:03 4,622,336 Qt5Gui.dll
    12/08/2013 20:00 1,392,128 Qt5Network.dll
    12/08/2013 20:08 6,281,216 Qt5Widgets.dll
    01/09/2014 23:19 1,461,760 wallch.exe@

    were wallch.exe is my app, which was made with release mode at Qt. Correct?
    So at the install wizard i just copy these 11 files at program files (x86) ?
    What should i do about x32 and x64 bit? I am a little bit confused :D

    1. As a lot of applications do, at the install wizard they ask for the application to be installed for the current user or for all users. If they select for all users, how will Qsettings save the settings at HKEY_LOCAL_MACHINE? Because even if run the exe as admin qsettings will keep saving the settings at current user..

    And for example if i want my app to start at windows startup, (so the user opens the Preferences settings of the app, and clicks the checkbox 'start at windows startup'), how do i write it to hkey_local_machine? Because i won't have admin previlages, and i dont want to force the user to open the app everytime as admin just for the startup option...



  • Found this 'article'
    http://qt-project.org/wiki/BuildingQtInstallers

    It seems really helpful, and it seems that i did everything right at my first question. But it does not point about 32/64 bit systems. Maybe i shouldn't care either? I mean maybe the exe that qt 'releases' works on both...?


  • Lifetime Qt Champion

    Hi,

    Unless you require 64 bit for e.g. huge ram use, you can safely go with 32bit. Windows 64 supports running 32bit application



  • [quote author="SGaist" date="1389567061"]Hi,

    Unless you require 64 bit for e.g. huge ram use, you can safely go with 32bit. Windows 64 supports running 32bit application
    [/quote]

    So qt releases the exe as 32 bit as default? even if i am on a 64 bit system right now?



  • [quote author="Leon" date="1389569042"]
    [quote author="SGaist" date="1389567061"]Hi,

    Unless you require 64 bit for e.g. huge ram use, you can safely go with 32bit. Windows 64 supports running 32bit application
    [/quote]

    So qt releases the exe as 32 bit as default? even if i am on a 64 bit system right now?[/quote]

    Good morning. I am not SGaist and i am a total noob to Qt but something that works the same on every Platform:

    In short:
    YES. Unless you use a x64-Bit Compiler, you will get x86 (32-Bit) Program.

    In long:
    Qt is by Default a 32-Bit Program which use a 32-Bit Compiler. But you can compile Qt + Qt Creator yourself with a 64-bit Compiler to get a 64-Bit Qt Library. After that you use a 64-Bit Compiler to make 64-Bit Program.

    I have read somewhere (sorry cant remember where), that you are able to use a 64-Bit Compiler in 32-Bit Qt Environment. But should this work, it would bring other Problems obviously.

    Have a good Day.
    Oliver



  • Thanks for your answer..
    Got the whole point about x32 and x64

    I read somewhere "Unless you need to access more memory that 32b addressing will allow you, the benefits will be small, if any."

    So no point for providing a 64 bit executable for my app as i don't need that much of memory.

    So question 1 is answered, anyone willing to answer q2?



  • [quote author="Leon" date="1389570321"]Thanks for your answer..
    Got the whole point about x32 and x64

    I read somewhere "Unless you need to access more memory that 32b addressing will allow you, the benefits will be small, if any."

    So no point for providing a 64 bit executable for my app as i don't need that much of memory.

    So question 1 is answered, anyway willing to answer q2?
    [/quote]

    Sorry i am new to this whole Qt Stuff my self. Havent figured this out my self yet. You are much more advanced as i am :) I have really only began to learn how things work.

    I darkly remember how things worked under Delphi (Pascal) and Windows XP but this will obviously not help you. Delphi worked different at many points.

    Good Luck!

    Oliver



  • Wanted to write anyone willing to answer q2?
    Sorry, edited :P


  • Lifetime Qt Champion

    Qt's not a program, it's a framework

    Anyway, the architecture of your application will depend on the compiler used and Qt's architecture will also be dependent on the compiler used to build it. If you installed Qt using one of the various packages, you'll need to check in the name (you can also analyze the dlls) so in short if you installed one of the 32bit variants -> 32bit applications otherwise 64bit.

    You can't mix architectures e.g. link your application with both 32 and 64 bit libraries


  • Moderators

    As others said - you will need separate builds for 32 and 64 bit - separate compilers and qt libraries builds.
    From the files you listed it looks like you use mingw 32 bit. qt does not provide 64 bit mingw binaries, so you would have to build them yourself (or look on the net for something prebuilt).

    As for the installer part. First thing is you're missing some more dlls:
    The platform plugin - should be located in <your app dir>/platforms/qwindows.dll (it's in plugins/platforms/ directory in your qt installation).
    Image plugins - if you're using gifs, icons etc. you should provide additional plugins in imageformats/q<plugintype>.dll (thy're in /plugins/imageformats in your qt installation)
    Any other plugins you might use - db, printing etc. same rule as above

    My personal preference is that there are two separate installers for 32 and 64 builds. You could provide a single installer for both but that would effectively triple the size of the package because of all the libraries.

    The settings. There are some considerations. If you want to install for all users - you will need administrative rights every time. Think about it. A user that runs an app writes settings for other users - he has to have admin rights to do it. You might on the other hand install for all users but save settings per user. This is actually the preferred way to do it since various users automatically get independent settings and you need admin rights only for the installer. You can also install for a single user which is ok too.

    Whatever you decide you can pass explicit registry paths to QSettings. Some runtime checking for the configuration might be a good idea.
    The paths for various configs are:
    32bit single user (very rare these days since almost all vista/win7/8 installations are 64bit):
    HKEY_CURRENT_USER\Software<Company><App>
    64bit single user (if your app is 64 bit):
    HKEY_CURRENT_USER\Software<Company><App>
    32bit app on 64bit system single user (most common):
    HKEY_CURRENT_USER\Software\Wow6432Node<Company><App>
    32bit all users:
    HKEY_LOCAL_MACHINE\Software<Company><App>
    64bit all users:
    HKEY_LOCAL_MACHINE\Software<Company><App>
    32bit app on 64bit system all users:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node<Company><App>

    Edit: For startup you can write to <HKLM/HKCU>\Software\Microsoft\Windows\currentVersion\Run. You need admin rights only if you do it for all users in HKLM (Which, as I said previously, should probably be per user anyway).


Log in to reply
 

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