Jump to content

How to call dll files


 Share

Recommended Posts

Hey there..

I am working on an uninstall and then install another program after, so they doesnt affect each other.

My problem is that i have an Uninst.dll, and i dont know how to call it so i can control it?

The function DllCall doesnt seem to work cause i cant get the call commands like it want me to write "MessageBox" or the controls for my Dll file.. where can i see those?

If it has any interrest it is the Hewlett Packard keyboard drivers im trying to uninstall via an AutoIT script.

Regards Hpost.

Link to comment
Share on other sites

You likely won't need to call the DLL with DLLCall, if the drivers appear in Add/Remove Programs you can search the subkeys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in the system registry (you might need to step over each subkey and look at the DisplayName value) for the entry for the drivers. If there is an entry the uninstall string that Windows would use is in the UninstallString value.

You can get this from AutoIt with:

$foo = "Hpost123'sDriverKeyNameInRegistry"
$uninst = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $foo, "UninstallString")
; Run the uninstall
RunWait($uninst)

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Thanks alot DaveF, i just need one more help from you or someone else.

Can anybody find the wrong thing in this script?

Or just build the right script for me.

Display name: Hewlett-Packard Extended Keyboard

UninstallString: C:\WINDOWS\IsUninst.exe -f"C:\Programmer\Hewlett-Packard\Extended Keyboard\Uninst.isu" -c"C:\Programmer\Hewlett-Packard\Extended Keyboard\Uninst.dll"

RegRead place: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

My script:

$foo = "Hewlett-Packard Extended Keyboard"
$uninst = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $foo, "C:\WINDOWS\IsUninst.exe -f"C:\Programmer\Hewlett-Packard\Extended Keyboard\Uninst.isu" -c"C:\Programmer\Hewlett-Packard\Extended Keyboard\Uninst.dll"")
; Run the uninstall
RunWait($uninst)

Edited by Hpost123
Link to comment
Share on other sites

Looks like you mixed the RegRead with the expected return value into one. Below should work for you. Just need to read the UninstallString value and run it.

$entry = "Hewlett-Packard Extended Keyboard"
$uninstall = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $entry, "UninstallString")
; Run the uninstall
If Not @error Then RunWait($uninstall)

Check for @error 1st before running the string is a good idea. :lmao:

Link to comment
Share on other sites

Thanks..

But its the error in my string i cant find.. Cause i dont know if i should start the Uninst string with a " and end it with "") or just ")

Didn't understand that, are you saying that MHz's code did not work?

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

I think it will work, but i get a failcode when i try to execute it.. I think theres something wrong with my string, maybe too many " " in it.. but maybe if you could write exactly how the script should look.. Maybe its because it cant read all the lines in my string.?

Link to comment
Share on other sites

$entry = "Hewlett-Packard Extended Keyboard"
$uninstall = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $entry, "UninstallString")
; Run the uninstall
If Not @error Then RunWait("'" & $uninstall & "'")

Try this. It would be a quote problem causing it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...