TheRandomLabs / scoop-nonportable

A Scoop bucket for nonportable applications.
The Unlicense
137 stars 40 forks source link

qttabbar-np install ERROR Exit code was 1603! #218

Open jaan-git opened 3 years ago

jaan-git commented 3 years ago

PS C:\Users\Administrator> scoop install qttabbar-np Installing 'qttabbar-np' (1043) [64bit] Loading QTTabBar_1043.zip from cache Checking hash of QTTabBar_1043.zip ... ok. Extracting QTTabBar_1043.zip ... done. Running installer script... ERROR Exit code was 1603! Linking ~\scoop\apps\qttabbar-np\current => ~\scoop\apps\qttabbar-np\1043 'qttabbar-np' (1043) was installed successfully!

dominsights commented 3 years ago

This also happens to me. I think it is a bit weird scoop says it was installed successfully when an error happened.

TheRandomLabs commented 3 years ago

As a workaround, install qttabbar-np@1042 for now.

dominsights commented 3 years ago

@jaan-git

Hello, why are you closing if it's not fixed?

dominsights commented 3 years ago

As a workaround, install qttabbar-np@1042 for now.

I have tried to tweak the script, but it seems it is an issue in scoop itself. In their install script, they ignore the error message generated inside the function Invoke-ExternalCommand. Therefore showing the success message.

We have two issues here:

dominsights commented 3 years ago

@TheRandomLabs I was able to fix the failed installation as success using this in the installer script (note that I used mosquitto as example):

"script": [ "$path = \"$dir\\mosquitto-2.0.10-install-windows-x64.exe\"", "$arguments = \"/S\"", "try {", "$process = Start-Process -FilePath $path -ArgumentList $arguments -PassThru -Wait -NoNewWindow", "if($process.ExitCode -ne 0) {", "exit $process.ExitCode", "}", "Write-Host \"Installer script executed with success!\"", "}", "catch {", "Write-Error $Error[0]", "exit 1", "}" ]

Edit: I wasn't able to fix the formatting, here is a picture: image

Edit 2: Invoke-ExternalCommand already does what I've done in my sample, you only need to check if its result is true or false and return exit 1 if false and the installation will be marked as failed.