Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Installer Framework and sh-scripts
Forum Updated to NodeBB v4.3 + New Features

Qt Installer Framework and sh-scripts

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
4 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #1

    Hello everyone,

    I try to deploy an App with the Qt InstallerFramework across platforms.

    For MacOS I run into a bit of an problem.

    The component.addOperation("CreateShortcut"...) is not supported and there seems to be no alternative. Pls correct me if I'm wrong here.

    So I created a script make-alias.sh

    #!/bin/bash
    osascript <<END_SCRIPT
    tell application "Finder" to make alias file to file (posix file "$1") at desktop
    END_SCRIPT
    

    this is shipped with my App-Bundle and executed in the Component.prototype.installationFinished = function()

    So far so good, it works as I want it to.

    Using the MaintenanceTool that is created by the Framework and upon selecting

    • Update components
    • Remove all components

    The alias gets not deleted/removed automatically.

    So I created a 2nd simple script remove-alias.sh

    #!/bin/bash
    rm -r ~/Desktop/AppName
    

    But I have no idea where and how to include this in the installerscript.qs. Any help is appreciated.


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      myk321
      wrote on last edited by
      #2

      @j-hilk said in Qt Installer Framework and sh-scripts:

      osascript

      In /config/config.xml you specify a control script:

      <ControlScript>deinstallscript.qs</ControlScript>
      

      Then in /config/deinstallscript.qs you invoke the .bash shell script using something like:

      Controller.prototype.uninstallationStartedFunction = function() {
      	try {
      
      		if (systemInfo.kernelType === "winnt") {
      			console.log("Uninstalling on Windows"); 
      
      		} else if (systemInfo.kernelType === "darwin") {
      			console.log("Uninstalling on MacOS");
      
      			//Use a bash to do the linux desktop specific de-installation
      			var args = ["@HomeDir@"];
      		    	installer.executeDetached("@TargetDir@/macUninstall.bash", args);
      
      		} else if (systemInfo.kernelType === "linux"){
      			console.log("Uninstalling on Linux");
      		}
      	} catch(e) {
      		console.log(e);
      	}
      }
      
      function Controller() {
      	installer.uninstallationStarted.connect(this, Controller.prototype.uninstallationStartedFunction);
      }
      
      J.HilkJ 1 Reply Last reply
      3
      • M myk321

        @j-hilk said in Qt Installer Framework and sh-scripts:

        osascript

        In /config/config.xml you specify a control script:

        <ControlScript>deinstallscript.qs</ControlScript>
        

        Then in /config/deinstallscript.qs you invoke the .bash shell script using something like:

        Controller.prototype.uninstallationStartedFunction = function() {
        	try {
        
        		if (systemInfo.kernelType === "winnt") {
        			console.log("Uninstalling on Windows"); 
        
        		} else if (systemInfo.kernelType === "darwin") {
        			console.log("Uninstalling on MacOS");
        
        			//Use a bash to do the linux desktop specific de-installation
        			var args = ["@HomeDir@"];
        		    	installer.executeDetached("@TargetDir@/macUninstall.bash", args);
        
        		} else if (systemInfo.kernelType === "linux"){
        			console.log("Uninstalling on Linux");
        		}
        	} catch(e) {
        		console.log(e);
        	}
        }
        
        function Controller() {
        	installer.uninstallationStarted.connect(this, Controller.prototype.uninstallationStartedFunction);
        }
        
        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        hi @myk321

        thanks for the answer, I hadn't the time to test it yet, so I'll leave to topic open for now, but I#ll come back to it later this week.

        I think you've tested this and from what I see your solution seems sounds. Is this bound to a specific version of the QtIFW ? Or has it been there from the beginning?


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          myk321
          wrote on last edited by
          #4

          @jhilk: I'm not sure if it's been there since the beginning, but have tested it against the latest version of QtIFW, so 3.1 on MacOs and Ubuntu and 3.0 on Windows.

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved