Jump to content

ptru

Members
  • Posts

    3
  • Joined

  • Last visited

ptru's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hmm I don't get it... This doesn't seem to work at all. I am using Windows 10 Pro x64 and trying to pack a simple Hello World script fails. I should see a MessageBox but instead a cmd window pops up and quickly disappears. When I try to run the file inside a standalone cmd.exe window, it crashes... #include <File.au3> #include <FileConstants.au3> #include <InetConstants.au3> #include <MsgBoxConstants.au3> #include <TrayConstants.au3> #include <WinAPIFiles.au3> MsgBox($MB_SYSTEMMODAL, "Hello World", "Hello World")
  2. Thank you, your code helped me to put together an ultimate function to check if an application is installed or not. No matter if 32bit or 64bit This might be helpful to others. ; Search Registry and Fallback to WMI (slower) ; $is64bit = -1: search 32bit and 64bit ; $is64bit = 0: search 32bit only ; $is64bit = 1: search 64bit only Func IsApplicationInstalled($appName, $is64bit = 0, $wmiFallback = 1) If $is64bit = -1 Then If IsApplicationInstalled($appName, 0, 0) = 1 Then Return 1 EndIf $is64bit = 1 EndIf $regList = GetRegUninstallList($is64bit) If $regList = -1 Then Return -1 For $key in $regList if StringLower($key) = StringLower($appName) Then Return 1 EndIf Next If $wmiFallback = 1 Then $wmiList = GetWMIList() If $wmiList = -1 Then Return -1 For $app in $wmiList if StringLower($app) = StringLower($appName) Then Return 1 EndIf Next EndIf Return 0 EndFunc Func GetRegUninstallList($use64bit = 0) $sRegHive = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" If $use64bit = 1 Then $sRegHive = "HKLM64\Software\Microsoft\Windows\CurrentVersion\Uninstall" EndIf Local $aUninstall[0] $i = 1 While 1 $sRegKey = RegEnumKey($sRegHive, $i) If @error Then ExitLoop _ArrayAdd($aUninstall, RegRead($sRegHive & "\" & $sRegKey, "DisplayName")) $i += 1 WEnd Return _ArrayUnique($aUninstall) EndFunc Func GetWMIList() Local $aResult[0] $sPC = @ComputerName $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sPC & "\root\cimv2") $colProducts = $oWMI.ExecQuery("SELECT * FROM Win32_Product") If IsObj($colProducts) Then For $product in $colProducts _ArrayAdd($aResult, $product.Caption) Next Return _ArrayUnique($aResult) EndIf Return -1 EndFunc
  3. Well... https://www.autoitscript.com/forum/topic/123146-list-installed-programs-and-system-information/ That script still works but it is not listing everything. I think it will only list system wide installations not including local user installations. Also it seems to list alot of Windows related stuff... like 50 different "Visual C++ Library" entries. I need to check if a specific programm is installed. Mod said create a new topic so here we are.
×
×
  • Create New...