I'm using Advanced Installer to try and create an installer (.exe) for an application I've created. Part of the installation process involves installing a USB driver.

After building my installer, I tried running it but it kept failing due to a DIFXAPP error where it was unable to write keys to the registry. After running the installer as an administrator, I was able to install the application.

However, I'm now having trouble uninstalling the program for a similar reason - during the uninstall process, DIFX will try to access the key in the registry that it added during installation (presumably to remove it). However, without admin rights this fails, causing the uninstallation process to rollback.

I'm doing all this on a Windows 7 64-bit machine. Is there a way to force a program to be uninstalled using elevated access?

  • In the installation directory, is there perhaps an uninstall.exe file? – var firstName Jul 6 '17 at 13:42
  • @varfirstName Unfortunately not. – Tagc Jul 6 '17 at 13:44
  • Often you can also use the installer itself to repair/uninstall the program if it was previously installed, but mine just says that I have to use Add/Remove Programs to do so. – Tagc Jul 6 '17 at 13:47
  • If your installer creator is advertised as Windows 7 compatible, it should have an option to handle UAC. If it doesn't, I suggest you consider using another one, since it is a strong sign of outdated software. MSI (Microsoft Installer) is the canonical way to create installers for Windows, and Windows has a native tool to create MSI packages. – Nathan.Eilisha Shiraini Jul 6 '17 at 13:51
  • @NathanShiraini Advanced Installer is modern and does have a way to handle UAC. However, I didn't realise while building the installer that I'd need to force elevated access (it has a checkbox for it). As a test, I tried running the already-built executable with elevated access, which allowed the program to install. But because the installer itself isn't expecting to be run with elevated access, I guess it doesn't prompt for it when trying to uninstall. – Tagc Jul 6 '17 at 13:54

It wasn't pretty but I've resolved this for myself by manually hunting down all references to my product in the registry and deleting those keys. I've also changed my installation to per-machine (for the time being) to force elevation for both installation and uninstallation.

I'd still appreciate a solution that doesn't involve messing with the registry if there is one, just in case for future reference.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.