Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Upgrade from gImageReader 3.4.1 to 3.4.2 failed with error #12

Open
robeke opened this issue Feb 24, 2024 · 3 comments
Open

Upgrade from gImageReader 3.4.1 to 3.4.2 failed with error #12

robeke opened this issue Feb 24, 2024 · 3 comments

Comments

@robeke
Copy link

robeke commented Feb 24, 2024

Upgrade from version 3.4.1 to 3.4.2 failed. Here is relevant portion of chocolatey.log:
2024-02-17 08:51:52,163 3448 [DEBUG] - ---------------------------Script Execution--------------------------- 2024-02-17 08:51:52,163 3448 [DEBUG] - Running 'ChocolateyScriptRunner' for gimagereader v3.4.1 with packageScript 'C:\ProgramData\chocolatey\lib\gimagereader\tools\chocolateyBeforeModify.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\gimagereader', installArguments: '', packageParameters: '', 2024-02-17 08:51:52,178 3448 [DEBUG] - Running 'C:\ProgramData\chocolatey\lib\gimagereader\tools\chocolateyBeforeModify.ps1' 2024-02-17 08:51:52,194 3448 [DEBUG] - Running 'Get-UninstallRegistryKey' for 'gimagereader' with SoftwareName:'gImageReader' 2024-02-17 08:51:52,194 3448 [INFO ] - VERBOSE: Retrieving all uninstall registry keys 2024-02-17 08:51:52,350 3448 [DEBUG] - Registry uninstall keys on system: 88 2024-02-17 08:51:52,350 3448 [DEBUG] - Error handling check: 'Get-ItemProperty' fails if a registry key is encoded incorrectly. 2024-02-17 08:51:52,444 3448 [DEBUG] - Found 1 uninstall registry key(s) with SoftwareName:'gImageReader' 2024-02-17 08:51:52,475 3448 [DEBUG] - Running Uninstall-ChocolateyPackage -validExitCodes '0' -fileType 'EXE' -silentArgs '/S' -packageName 'gimagereader' -file 'C:\Program Files\gImageReader\Uninstall.exe" /AllUsers' 2024-02-17 08:51:52,491 3448 [INFO ] - Uninstalling gimagereader... 2024-02-17 08:51:52,538 3448 [DEBUG] - Running Start-ChocolateyProcessAsAdmin -validExitCodes '0' -statements '/S ' -exeToRun 'C:\Program Files\gImageReader\Uninstall.exe" /AllUsers' 2024-02-17 08:51:52,538 3448 [DEBUG] - Unable to use current location for Working Directory. Using Cache Location instead. 2024-02-17 08:51:52,553 3448 [DEBUG] - Test-ProcessAdminRights: returning True 2024-02-17 08:51:52,569 3448 [DEBUG] - Elevating permissions and running ["C:\Program Files\gImageReader\Uninstall.exe" /AllUsers" /S ]. This may take a while, depending on the statements. 2024-02-17 08:51:52,585 3448 [ERROR] - ERROR: Exception calling "GetFullPath" with "1" argument(s): "Illegal characters in path." 2024-02-17 08:51:52,585 3448 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\gimagereader\tools\chocolateyBeforeModify.ps1' -installArguments '' -packageParameters '' -forceX86'] exited with '-1'.

@robeke robeke changed the title Upgrade from 3.4.1 to 3.4.2 failed with error Upgrade from gImageReader 3.4.1 to 3.4.2 failed with error Feb 24, 2024
@jonasw234
Copy link
Owner

Hi robeke,

thanks for your error report! It looks like you used additional installer arguments which breaks the uninstall-before-reinstalling logic. The easiest way is probably to just uninstall gImageReader manually and then reinstall the new version.

I’ve also just pushed a version that should work fine with additional installer arguments, but unless this is a prevalent issue I’m hesitant to push the update out to everyone as that would mean increasing the version number of my package manually which might lead to confusion or worse missing real updates because the version I faked is used by the original author.

Please feel free to reopen if the issue persists!

@robeke
Copy link
Author

robeke commented Feb 28, 2024

Hi jonasw234,
I use chocolatey as the Windows package provider in Puppet manifests. For gImageReader, the only additional argument I'm passing is [--x86] since there is an old Epson scanner on the network that uses a 32 bit Twain driver. I'm not really sure where the /AllUsers argument for the uninstaller originated but I did not explicitly include it. I guess it could be something the Puppet package resource does under-the-covers.

That being said, this may be an edge case so probably no need to push an out-of-cycle update. I had already uninstalled manually as you recommended and locally hosted a modified version 3.4.2 nupkg that supported the [--x86] argument. I do see that the UninstallString for gImagerReader 3.4.2 in the Windows registry is the same as it was for 3.4.1 which is "\"C:\\Program Files (x86)\\gImageReader\\Uninstall.exe\" /AllUsers" so I suspect the chocolateyBeforeModify.ps1 will fail again since the Trim function used in that script does not account for the quote in this string that is neither at the beginning or the end.

@jonasw234
Copy link
Owner

Interesting, thanks for your detailed report!
I’ll look into it some more and perform some tests so that I can hopefully come up with a reliable method to upgrade this package.

@jonasw234 jonasw234 reopened this Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants