[Qt-creator] Making an installer of Qt creator plugin on Windows

Artem Razin artem.razin at gmail.com
Mon May 6 09:48:27 CEST 2019


> How do you decide if the detected Qt Creator fits your plugin configuration?

I've collected list of VC compiler and Qt versions for each official
Qt Creator build X.Y.Z that I want to support. Then I made a script to
correctly build the plugin for each X.Y.Z.

It took some time but now I can build for 4.5.0 - 4.9.0.

The installer enumerates subkeys of
(HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE)\Software\Microsoft\Windows\CurrentVersion\Uninstall,
looking at DisplayName and DisplayVersion to check whether it's a
separate Qt Creator installation, or full Qt installation that
includes Qt Creator in Tools.

Then it uses InstallLocation to locate qtcreator.exe, then retrieves
its bitness and version. If it's suppored, the plugin dll is copied to
the plugin directory.

Of course I will add instructions how to use the plugin is the
installer fails to locate Qt Creator.

On Mon, May 6, 2019 at 10:10 AM Eike Ziller <Eike.Ziller at qt.io> wrote:
>
>
>
> > On 3. May 2019, at 16:52, Artem Razin <artem.razin at gmail.com> wrote:
> >
> > Oh, got the point!
> >
> > Regarding the idea of installing to
> > %LOCALAPPDATA%\QtProject\qtcreator\plugins\X.Y.Z, will it work if both
> > 32-bit and 64-bit of Qt Creator of the same versions X.Y.Z
> > installed?..
>
> Hm, interesting.
> No, it doesn’t take into account different bitness, nor different compilers (mingw/msvc/...), nor different Qt versions (there are chances that a plugin that uses Qt 5.X fails to load with a Qt Creator coming with Qt 5.X-1, e.g. if it uses new API), or any other difference in configuration that might exist.
> I’m not sure if we can, or even should try to solve that issue...
>
>
> > It seems that no and I again have to return to the task
> > of detection of all installed Qt Creators.
>
> How do you decide if the detected Qt Creator fits your plugin configuration?
>
> > On Fri, May 3, 2019 at 5:35 PM Eike Ziller <Eike.Ziller at qt.io> wrote:
> >>
> >>
> >>
> >>> On 3. May 2019, at 16:04, Artem Razin <artem.razin at gmail.com> wrote:
> >>>
> >>> Hi Eike,
> >>>
> >>>> Since “installing” a plugin in Qt Creator means to just drop some files somewhere, you probably could just ask?
> >>>
> >>> Yes, but it would look a bit weird because there is some installer
> >>> already that installs Deleaker to Visual Studio, RAD Studio, as a
> >>> standalone application and if it suddenly asked to copy some dll to
> >>> some location... Of course, developers are able to copy a file :) but
> >>> if an installer copied the file it would be much better!
> >>
> >> I meant that the installer could ask for the install location(s) of Qt Creator where it shall install the files to :)
> >>
> >>>
> >>>> Another location that Qt Creator looks for _user_ specific plugins is in
> >>>> %LOCALAPPDATA%\QtProject\qtcreator\plugins\X.Y.Z
> >>>> where X.Y.Z is the Qt Creator version.
> >>>
> >>> Just tried and indeed it works very well. Thank you for the idea.
> >>>
> >>> So now an installer can just create folders X.Y.Z for all supported
> >>> versions and place a plugin dll to each folder.
> >>>
> >>> Thank you!
> >>>
> >>> On Fri, May 3, 2019 at 10:05 AM Eike Ziller <Eike.Ziller at qt.io> wrote:
> >>>>
> >>>>
> >>>>
> >>>>> On 2. May 2019, at 18:34, Artem Razin <artem.razin at gmail.com> wrote:
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> I am really a newbie in Qt world, and unfortunately Google didn't help
> >>>>> me this time.
> >>>>>
> >>>>> Currently I am working on an installer for my plugin for Qt Creator on
> >>>>> Windows, but I just can't find a good way to enumerate all installed
> >>>>> Qt Creators (to copy the plugin dll to a plugin directory of each
> >>>>> installed version).
> >>>>>
> >>>>> I realized that (at least) fresh Qt builds can be found in
> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\***,
> >>>>> so an installer could check all such entries, then check presence of
> >>>>> qtcreator.exe in <InstallLocation>\Tools\QtCreator\bin\qtcreator.exe
> >>>>> (<InstallLocation> is a value of "InstallLocation" in
> >>>>> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\***).
> >>>>>
> >>>>> Is there a better way?
> >>>>>
> >>>>> Might it happen that this way will not work, i.e. probably there is
> >>>>> another way of installing Qt Creator?
> >>>>
> >>>> There are the Qt Creator-only offline installers which install to <InstallLocation>\bin\qtcreator.exe
> >>>> And I think e.g. chocolatey has a Qt Creator package too, and possibly other “unofficial” ways.
> >>>>
> >>>>> What's a common way to distribute Qt creator plugins? Just looked at
> >>>>> qtc-cppcheck, and they just distribute a compiled dll, without an
> >>>>> installer at all...
> >>>>
> >>>> Since “installing” a plugin in Qt Creator means to just drop some files somewhere, you probably could just ask?
> >>>>
> >>>> Another location that Qt Creator looks for _user_ specific plugins is in
> >>>> %LOCALAPPDATA%\QtProject\qtcreator\plugins\X.Y.Z
> >>>> where X.Y.Z is the Qt Creator version.
> >>>>
> >>>> Which makes me aware that we should probably make it look in X.Y too nowadays, since we provide binary compatibility through patch releases since a while...
> >>>>
> >>>> Br, Eike
> >>>>
> >>>> --
> >>>> Eike Ziller
> >>>> Principal Software Engineer
> >>>>
> >>>> The Qt Company GmbH
> >>>> Rudower Chaussee 13
> >>>> D-12489 Berlin
> >>>> eike.ziller at qt.io
> >>>> http://qt.io
> >>>> Geschäftsführer: Mika Pälsi,
> >>>> Juha Varelius, Mika Harjuaho
> >>>> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
> >>>>
> >>>
> >>>
> >>> --
> >>> Best regards,
> >>> Artem A. Razin
> >>
> >> --
> >> Eike Ziller
> >> Principal Software Engineer
> >>
> >> The Qt Company GmbH
> >> Rudower Chaussee 13
> >> D-12489 Berlin
> >> eike.ziller at qt.io
> >> http://qt.io
> >> Geschäftsführer: Mika Pälsi,
> >> Juha Varelius, Mika Harjuaho
> >> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
> >>
> >
> >
> > --
> > Best regards,
> > Artem A. Razin
>
> --
> Eike Ziller
> Principal Software Engineer
>
> The Qt Company GmbH
> Rudower Chaussee 13
> D-12489 Berlin
> eike.ziller at qt.io
> http://qt.io
> Geschäftsführer: Mika Pälsi,
> Juha Varelius, Mika Harjuaho
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
>


-- 
Best regards,
Artem A. Razin


More information about the Qt-creator mailing list