Have you been struggling to find the solution for the error message ‘Sage 50 Server returned unexpected error 1640 attempting to install package’ and not able to find a way out to fix it? Well, you have come to the right place as we can assist you in resolving this issue.

In this article, we aim to highlight some of the prime causes of the error messageSage 50 Server returned unexpected error 1640 attempting to install package’ as well as methods to fix this Sage software glitch without much hassle.

Prime causes of the error message Sage 50 Server returned unexpected error 1640 attempting to install package

Here are some of the causes that can instigate this error message:

  • When the user doesn’t have requisite permission to either install or uninstall the program
  • When the Windows Installer service is not functioning properly

How to troubleshoot the error message Sage 50 Server returned unexpected error 1640 attempting to install package?

Solution 1: Confirm whether the Windows Installer is working or not

Note: If you are not much confident about carrying out the given below steps, we would recommend seeking the Sage 50 assistance of the Accountinghub Sage tech support team now.

To determine whether Windows Installer is there in your system or not:

  • Go to Start, open Run, type msiexec, and press OK.
  • When prompted, try to read at the top of the opened dialog box the version of the Windows Installer which is already set up in your PC
  • It should look something like this “Windows ® Installer. V 4.5.6005.23168 “

If you are trying to open your Windows Installer and the access to same is revoked, then you need to perform the following steps:

Again register Windows Installer

  1. Confirm the site of the Msiexec.exe file your hard disk. For this, perform these steps:
  • Go to Start, look for Files or Folders.
  • SelectAll files and folders.
  • When prompted, type Msiexec.exe, and select Search.
  • Notesite of the Msiexec.exe file.
  • Go to File menu, click Exit.
  1. Confirmthe site of the Msiexec.exe file in the Windows registry. For this, perform these steps:
  • Go to Start, open Run, type Regedit, and hit Ok tab.
  • Find and select the given registry key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer
  • Click twice on ImagePath.
  • When Edit String window opens, ensure the string in the Value data box has the right path of the Msiexec.exe file on the hard disk.
  • On the other hand, if the value data box doesn’t have the right path, rectify the same and click OK.
  • Exit Registry Editor.
  1. Reboot your computer in Safe Mode, and then list the Msiexec.exe file.

Reinstall Windows Installer

  • Go to Start, open Run, type cmd, and click OK.
  • When prompted, type attrib -r -s -h %Windir%\System32\dllcache.
  • When prompted, typeCD %Windir%\System32, and hit ENTER.
  • When prompted, type the given lines, hitting ENTER after each line:
    1. ren msi.dll msi.old
    2. ren msiexec.exe msiexec.old
    3. ren msihnd.dll msihnd.old
  • When prompted, type exit, and hit ENTER.
  • Reboot your computer in Safe Mode.
  • Upgrade your Windows Installer files on the hard disk to the newest version.
  • Again reboot your system when you have installed the latest version of Windows Installer.

Solution 2: If Windows Installer is working perfectly, sign in Windows as an Admin user to uninstall Pervasive.

  • Close all the files opened in the Sage 50 software
  • HoldWindows+R keys in one go
  • When prompted, write Control Panel, and hit OK
  • Choose Programs & Features
  • Uninstall any recordedform of Pervasive PSQL Workgroup Engine
  • Exit Control Panel
  • HoldWindows+R keys together and type C:\, and click OK
    • If exists, obliterate the folder pvsw and pvswarch
    • If present, obliterate any file titledPSQL_v[version number]_Install.log
  • Go to C:\Windows
    • If exists, obliterate pvsw.log
  • Go to C:\ProgramData
    • If exists, name again Pervasive Software folder to OldPervasive Software
  • Go to C:\Program Files or C:\Program Files (x86)
    • If exists, name again Pervasive Software folder to OldPervasive Software
  • Go to C:\Program Files\Common Files or C:\Program Files (x86)\Common Files
    • If exists, name again Pervasive Software Shared to OldPervasive Software Shared
  • Shut down Computer
  • HoldWindows+R keys together and type regedit and then click ok
  • Do right click on system > Export >Keep a backup of Registry
  • Go to HKEY_LOCAL_MACHINE\Software or HKEY_LOCAL_MACHINE\Software\Wow6432Node
    • If exists, obliterate Pervasive Software and PEYX489ZK
  • Exit from the Registry Editor

If you are facing problem while resolving the error notification ‘Sage 50 Server returned unexpected error 1640 attempting to install package’, then dial us at our Sage 50 tech support helpdesk 1 844 313 4856 to speak to Accountinghub Sage 50 technical support team.