diff --git a/lib/decompress.ps1 b/lib/decompress.ps1 index 3dc3f73106..4606ce4c18 100644 --- a/lib/decompress.ps1 +++ b/lib/decompress.ps1 @@ -180,7 +180,12 @@ function Expand-InnoArchive { $Removal ) $LogPath = "$(Split-Path $Path)\innounp.log" - $ArgList = @('-x', "-d`"$DestinationPath`"", "-c`{app`}\$ExtractDir", "`"$Path`"", '-y') + $ArgList = @('-x', "-d`"$DestinationPath`"", "`"$Path`"", '-y') + switch -Regex ($ExtractDir) { + "^[^{].*" { $ArgList += "-c{app}\$ExtractDir" } + "^{.*" { $ArgList += "-c$ExtractDir" } + Default { $ArgList += "-c{app}" } + } if ($Switches) { $ArgList += (-split $Switches) }