Results 1 to 20 of 24

Thread: Small task for Windows programmers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Small task for Windows programmers

    I have a small and probably very simple task for people programming for Windows. Correct me if I'm wrong, but if you compile Qt from sources on Windows, you don't get start menu entries related to the build. Of course one can always create such a group and shortcuts himself, but why not write a small batch script that would do it for us? We could place it in the wiki, so that people can benefit from it. From my point of view the script should create entries such as shortcuts to Qt tools - Designer, Assistant, Linguist and to a Qt command prompt with all variables set - just like the menu Trolltech creates when installing from binary. Or maybe such a script already exists? In that case, could you point me to it?

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Small task for Windows programmers

    Quote Originally Posted by wysota View Post
    ...but why not write a small batch script that would do it for us?
    Are you volunteering?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    No, I'm looking for a volunteer I'm not experienced in Windows. I don't know how to add an entry to the menu from within a script, etc.

    Are you volunteering?

    Do you think this is a sane idea at all? It's just something that came to my mind after compiling Qt on Windows...
    Last edited by wysota; 25th October 2007 at 21:37. Reason: updated contents

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small task for Windows programmers

    . I don't know how to add an entry to the menu from within a script, etc.
    You can go around that and copy the links to the start menu folder.

    But I'll see what I can do when I have the time, maybe in the weekend. That is if someone doesn't do it till then.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    But I don't have the links. I don't have a binary release installed, just the source. So the steps needed are:
    1. create links
    2. create a folder in the start menu
    3. move links to the above mentioned folder
    4. create a script that will setup all the vars
    5. create a link that will run the script
    6. move the link (or the script directly) to the folder
    7. say "voilla"

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small task for Windows programmers

    Quote Originally Posted by wysota View Post
    But I don't have the links. I don't have a binary release installed, just the source. So the steps needed are:
    1. create links
    2. create a folder in the start menu
    3. move links to the above mentioned folder
    4. create a script that will setup all the vars
    5. create a link that will run the script
    6. move the link (or the script directly) to the folder
    7. say "voilla"
    Voilla!
    Since what you asked for is not possible with a batch script, I turned my head towards WSH. So you guys can find enclosed a small vb script, which you can test. If your Windows installation is somehow missing wscript, then you're out of luck, but normally, it should be there.
    The script will prompt you to enter the Qt instalation root, such as C:\Qt\4.3.2 and it will do the work from there.

    Currently it creates shortcuts for all the 4 tools and command prompt, and also creates a qtvars.bat which sets the environment. The makespec is hardcoded to win32-g++.

    To run the script, just double-click it.
    Attached Files Attached Files

  7. The following user says thank you to marcel for this useful post:

    wysota (27th October 2007)

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    Great! I'll test it tomorrow. Unfortunately I'll be testing it with msvc, but I understand fixing the specs shouldn't be much work.

  9. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small task for Windows programmers

    Quote Originally Posted by wysota View Post
    Great! I'll test it tomorrow.
    It works fine for me, on Vista even, with UAC enabled. But some users have very strict security configurations (I call it paranoia) so the scripting host might be disabled.

    So, if possible, someone should test it on XP too, but my opinion is that if it works on Vista with UAC it should work very well on XP.

    If not, the only alternative is a native application that does the very same thing. Something like an installer.

    Unfortunately I'll be testing it with msvc, but I understand fixing the specs shouldn't be much work.
    Yes, just modify the line txtStream.WriteLine("set QMAKESPEC=win32-g++") with what you need, and also the comment above it. Or, edit the generated batch file.

    BTW, Qt should be already compiled when you run the script . If not, it will probably throw some runtime errors. I didn't exactly handled them all.
    Last edited by marcel; 27th October 2007 at 21:21.

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    I wonder if it's possible to auto detect the specs like Qt does. The script could then be extended to find it itself.

  11. #10
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small task for Windows programmers

    What do you mean? Qt knows because it's reading the QMAKESPEC env variable.

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    Quote Originally Posted by marcel View Post
    What do you mean? Qt knows because it's reading the QMAKESPEC env variable.
    I mean to be able to auto detect the specs from within the script to set the variable in the first place. If QMAKESPEC is not set, I know qmake tries (and often manages) to detect it. Maybe the script could use it somehow... but it would require qmake to dump the information somewhere, maybe it does...

  13. #12
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Small task for Windows programmers

    Quote Originally Posted by wysota View Post
    Are you volunteering?
    No! I don't know much about Windows either. Which is why I use NSIS or BitRock to install Qt apps on that godforsaken platform.

  14. #13
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Small task for Windows programmers

    No! I don't know much about Windows either. Which is why I use NSIS or BitRock to install Qt apps on that godforsaken platform.
    I first want to say that I literally hate Windows and any other MS product! But "godforsaken"? Come on guys... That operating system is more popular among developers than all the other platforms.
    I don't know much about the IT industries int you countries, but how does a developer can earn a decent buck there? From Linux programming? A .NET or JEE developer makes far more money than a developer doing c/c++ in Linux . I think that's a fact, at least for the past few years and at least a few to come.

  15. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Small task for Windows programmers

    For me it's easier to find a well paid assignment abroad than to look for it in Poland. I would probably find something I'd like to work on, but I doubt I'd be satisfied with the financial side of it. That's why it says "freelancer" in my LinkedIn profile.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.