-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(decompress): use innoextract if innounp fails #4192
Conversation
… is unsupported by innounp 0.49
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unacceptable to have two same dependencies for one thing. Allow it as config option.
Same as for lessmsi
- Do not use tabs
- Never ever use 'linux-like' commands/aliases in powershell scripts
I have changed according to your suggestions. |
lib/install.ps1
Outdated
@@ -582,6 +582,8 @@ function dl_urls($app, $version, $manifest, $bucket, $architecture, $dir, $use_c | |||
$extract_fn = $null | |||
if ($manifest.innosetup) { | |||
$extract_fn = 'Expand-InnoArchive' | |||
} elseif($manifest.innoexsetup) { | |||
$extract_fn = 'Expand-InnoExArchive' | |||
} elseif($fname -match '\.zip$') { | |||
# Use 7zip when available (more fast) | |||
if (((get_config 7ZIPEXTRACT_USE_EXTERNAL) -and (Test-CommandAvailable 7z)) -or (Test-HelperInstalled -Helper 7zip)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use something like this:
Best possible add simple switch parameter (-UseInnoExtract
or just -InnoExtract
) to expand-innoarchive function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it back. Sorry.
Only use this in depends:
if ($manifest.innosetup) { if (get_config 'INNOSETUP_USE_INNOEXTRACT' $false) { $depends += 'innoextract' } } else { $depends += 'innounp' }
And then inside decompress, inside function Expand-InnoArchive use same logic:
if get_config ''... {
$Stratus = INvoke-external Innoextract
} else {
$status = Invoke-External innounp }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to use something like this:
Thanks! I did not understand at first.
Best possible add simple switch parameter (
-UseInnoExtract
or just-InnoExtract
) to expand-innoarchive function
Yea, that is indeed better. I shall try that out later in the day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, to add the switch parameter/option, do I edit scoop-install.ps1
and scoop-update.ps1
in scoop\libexec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ash258 May I know how exactly do I add a switch parameter? Thanks.
To implement a complete solution, I searched for innounp and found we should consider also updating: |
Hi, may I know if there is anything else for me to improve on? Maybe other than the switch parameter @Ash258 suggested? |
Well this will not work for most of the packages. Since innoextract is only simple implementation it cannot be used the same way as innounp. See all manifests, which have two different architectures coming from single inno archive. It does not support extraction the same way as innounp, which will break lots of other stuff if this is configured. It would make sense to force it only for the relevant. So introducing new switch to the Expand-Inno function and then change all the relevant manifests should solve it. The configuration option could stay for some experiments and for future when innoextract catch up. So I would propose to just add new switch |
Apologies for not responding. Thank you so much for your guidance and explanation. Following your instructions, I have added the new switch parameter |
lib/install.ps1
Outdated
@@ -9,7 +9,7 @@ function nightly_version($date, $quiet = $false) { | |||
"nightly-$date_str" | |||
} | |||
|
|||
function install_app($app, $architecture, $global, $suggested, $use_cache = $true, $check_hash = $true) { | |||
function install_app($app, $architecture, $global, $suggested, $use_cache = $true, $check_hash = $true, $useinnoextract) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be patched in manifests itself. with Expand-InnoArchive -UseInnoextract
It is nonsense to have additional switch, and 20 checks for this.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I did not understand the part about the patch being in the manifest instead. Really sorry for the hassle caused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patches in the manifest should be something similar to the instaler script in this manifest, right?
Not needed. |
Right now, the latest version of innounp (0.49) does not support newer versions of Inno Setup (like version 6.1.0). While the issue has already been raised on its SourceForge (here and here), an update to innounp does not seem imminent.
As a result, many applications could not be installed due to
decompress error
. These include ScoopInstaller/Extras#5223 ScoopInstaller/Extras#5213 and many more which I would list at the end.I found dscharrer/innoextract. It is well supported and updated, and it works with the newer versions of Inno Setup. Thus, I edited
decompress.ps1
so that if innounp fails, innoextract will be tried. I have also edited the code ofdepends.ps1
andcore.ps1
to make innoextract dependent.I apologise in advance if my pull request and/or commit is not up to the standard because I am somewhat inexperienced. However, I still hope this would help others who are facing this issue.
Thanks!
Known Issues:
ScoopInstaller/Extras#5223
ScoopInstaller/Extras#5213
ScoopInstaller/Extras#5218
ScoopInstaller/Extras#5136
ScoopInstaller/Extras#5127
ScoopInstaller/Extras#5186
ScoopInstaller/Extras#5225