Page 1 of 1

Creating a package without an uninstall key found

Published: September 5, 2018 - 3:02 PM
by troublestarter
Hello,

what parameter can I pass to uninstallkey to ensure the package installs correctly? The uninstallkey error below is already preventing proper installation; installing and uninstalling the application from the DOS command line works without any issues.

No registry key is found because the program installs in the user profile:
`wapt-get list-registry XXX
UninstallKey Software Version Uninstallstring`.
I

tried adding the following to setupy.py: `uninstallkey = ['cd %appdata%\XXX\ && unins000.exe /VERYSILENT /NORESTART']`.

Here is the error: `
installing XXX
EWaptException: The uninstall key: cd %appdata%\XXX\ && unins000.exe /VERYSILENT /NORESTART has not been found in system registry after software installation`.

For your information, I left the Uninstallkey parameter empty when generating the package via the console.

Re: Creating a package without an uninstall key found

Published: September 5, 2018 - 3:16 PM
by htouvet
If the application installs in the user profile, then the installation code must be placed in the
package's `session_setup()` function, not in the `install()` function. Furthermore, do not use the `install_exe_if_needed` or `install_msi_if_needed` functions, which check for the existence of the `uninstallkey` registry key. Instead, simply use `run()`, which launches a command (like in a command prompt) without checking anything (except the return code)

. The WAPT service operates under the system account. So, it will install the application in the system account profile...

Generally, application installers have a flag allowing installation for all users (e.g., /ALLUSERS).
Software developers often install in the user profile to bypass restrictions imposed by administrators (especially for users with restricted accounts).

Note that in an "Enterprise" infrastructure, to protect against cryptolockers, a good practice is to enable SRP (or AppLocker) policies, and therefore it is also good practice not to create WAPT packages that install software outside of standard locations (Program Files, etc.).

Re: Creating a package without an uninstall key found

Published: September 5, 2018 - 3:17 PM
by troublestarter
Thanks for the quick reply.
I'll test it.