ebourg / jsign

Java implementation of Microsoft Authenticode for signing Windows executables, installers & scripts
https://ebourg.github.io/jsign
Apache License 2.0
250 stars 107 forks source link

Unsupported file error with ps1 file #137

Closed michaelst closed 1 year ago

michaelst commented 1 year ago

This is the file contents of the file I'm getting the error on


#This will uninstall all msi versions of 7-Zip

$AppName = "7-Zip *"

ForEach ( $Architecture in "SOFTWARE", "SOFTWARE\Wow6432Node" )
{ 
 $UninstallKeys = "HKLM:\$Architecture\Microsoft\Windows\CurrentVersion\Uninstall"
 if (Test-path $UninstallKeys)
 {
  $GUIDKey = Get-ItemProperty -Path "$UninstallKeys\*" | Where-Object -FilterScript { $_.DisplayName -like $AppName }
  $GUIDRealKey = $GUIDKey | select-object PSChildName -ExpandProperty PSChildName

  If ( $GUIDKey -ne $null -and $GuidRealKey -notlike "7-Zip" ) {
   $GuidRealKey | ForEach-Object {
    $GUID = $_
    Write-Output "Uninstalling: $(( Get-ItemProperty "$UninstallKeys\$GUID" ).DisplayName) " 
    Start-Process -Wait -FilePath "MsiExec.exe" -ArgumentList "/X$GUID /qn /norestart"
   }
  } Else { 
   Write-Output "$AppName installation not found in: $UninstallKeys"
  }
 }
}
michaelst commented 1 year ago

oh looks like the problem is that the file extension is stripped by my server during the upload process, I didn't have that issue with other formats, maybe there is a limitation with ps1 for that