Chimaera Posted October 8, 2015 Share Posted October 8, 2015 I tried this on a laptop at work$oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2") $aProducts = $oWMI.ExecQuery("Select * from Win32_Product Where Name LIKE '%CyberLink Power2Go 8%'") For $app in $aProducts $app.Uninstall() NextAnd it completely ignored it, but when i did this$oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2") $aProducts = $oWMI.ExecQuery("Select * from Win32_Product Where Name LIKE '%Power2Go%'") For $app in $aProducts $app.Uninstall() NextIt uninstalled it but damaged the programs and features entry so it threw an error if you used it afterdoes a space not count as a letter?and why did the second one damage the uninstaller? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted October 8, 2015 Share Posted October 8, 2015 The space should not be an issue its just using that to search the name and if it matches a name it is using the full result of the search to do the uninstall.Maybe just maybe there was more to the name than you thought that caused the first search to fail where the 2nd one did not.As for the failed uninstall, I imagine thats just an issue with the programs uninstaller if called from WMI. Link to comment Share on other sites More sharing options...
Chimaera Posted October 8, 2015 Author Share Posted October 8, 2015 I'm seeing a new breed of uninstalls lately on the new stuff where they seemed to have changed something to do with the new InstallShield launchI normally uninstall this way from a large array of uninstall names but i'm finding this method doesn't seem to work like it used to with the latest uninstall entriesFor $UninstallLoop = 1 To $aUninstallList[0] If StringInStr($aUninstallList[$UninstallLoop], 'MsiExec.exe', 1) Then ; Check For MSI Uninstaller Sleep(200) $aUninstallList[$UninstallLoop] = StringReplace($aUninstallList[$UninstallLoop], "/I", "/X") ; Change I to X to force uninstall rather than change $PID = Run($aUninstallList[$UninstallLoop] & ' /qb /quiet /passive /norestart') ; Start uninstall process with switches to create $PID _ProcessWaitCloseRec($PID, 180) ; Uninstall by waiting for process to stop If @error < 0 Then MsgBox(64, 'Uninstall Failure', 'Failed Uninstall ' & $aUninstallList[$UninstallLoop]) Sleep(1000) _WindowClose() ; Close any popup browser windows Else Sleep(200) If FileExists($aUninstallList[$UninstallLoop]) Then $PID = Run($aUninstallList[$UninstallLoop] & ' /s /S /sp- /silent /norestart /remove /q0 /uninstall') ; Start uninstall process with switches to create $PID _ProcessWaitCloseRec($PID, 180) ; Uninstall by waiting for process to stop If @error < 0 Then MsgBox(64, 'Uninstall Failure', 'Failed Uninstall ' & $aUninstallList[$UninstallLoop]) Sleep(500) _WindowClose() ; Close any popup browser windows EndIf EndIf GUICtrlSetData($hProgress, $iUnInstallIndex) $iUnInstallIndex += 1 NextAnd it ignores them and goes straight past, which is why i was seeing if the code in the first post would do the trickeven this on its own via cmd fails to remove themstart /wait msiexec /qn /norestart /x {39337565-330E-4ab6-A9AE-AC81E0720B10}something has changed and i cant put my finger on it yetThe programs and features is now just a link that points hereC:\Program Files\InstallShield Installation Information\{409370D3-226D-412A-852A-F134B89F7116}\Setup.exeWhich then removes the file.I dont remember it being this convoluted before... If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted October 8, 2015 Share Posted October 8, 2015 Bad programing on the behalf of the devs. I see it all the time lol.You should see the last manual uninstall I wrote, had to scan the registry for every key that had the program name in it as its own uninstall string did not work same as you said and it has no uninstall.exe Link to comment Share on other sites More sharing options...
Chimaera Posted October 8, 2015 Author Share Posted October 8, 2015 The oddity with the new ones isThey work fine from Programs And FeaturesThey work fine if you run setup.exe from the installshield folder Its only when you automate them they resist If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AdamUL Posted October 9, 2015 Share Posted October 9, 2015 InstallShield is a pain. You will need create an uninstall answer file using the command line with switches /r /f1 to uninstall it silently. I usually use a test box to record the install and uninstall answer files. Here's the command line reference. http://helpnet.installshield.com/installshield18helplib/IHelpSetup_EXECmdLine.htm Adam Link to comment Share on other sites More sharing options...
Chimaera Posted October 10, 2015 Author Share Posted October 10, 2015 (edited) Thanks for that AdamSo your saying i can no longer get away with just uninstall by name for these newer installshield ones like$PID = Run($aUninstallList[$UninstallLoop] & ' /qb /quiet /passive /norestart')Im going to have to create that around the setup.exe instead y?$PID = Run('C:\Program Files\InstallShield Installation Information\{409370D3-226D-412A-852A-F134B89F7116}\Setup.exe' & ' /qb /quiet /passive /norestart') Thats just a mock up btw Edited October 10, 2015 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AdamUL Posted October 12, 2015 Share Posted October 12, 2015 Your welcome. Give it a shot, but it depends on how they setup the installer. I have seen some that allows you to use MSI commands, and other that would not. The most reliable way I have seen is to use an answer file, but I would try both to find out which works best for you. Adam Link to comment Share on other sites More sharing options...
Chimaera Posted October 12, 2015 Author Share Posted October 12, 2015 (edited) If the installer has been done without the answer file can it still respond to one if i make an answer file for it?And if it was the same proggie on a different brand machine would it still work with the same answer file? Edited October 12, 2015 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AdamUL Posted October 12, 2015 Share Posted October 12, 2015 Yes, it will respond to an uninstall answer file. It does not matter the brand of machine. The answer file is basically an automation of the GUI interface, without interacting with the GUI directly when it is run using the answer file. The only thing to remember, is the answer file will be different, if the developer changes the GUID between version or updates. Here are some examples of a setup and uninstall answer files created for the ILLiad Client. Your application answer files will be similar. setup.iss[{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-DlgOrder] Dlg0={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdWelcome-0 Count=5 Dlg1={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SetupType2-0 Dlg2={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdAskDestPath-0 Dlg3={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdStartCopy2-0 Dlg4={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdFinish-0 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdWelcome-0] Result=1 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SetupType2-0] Result=304 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdAskDestPath-0] szDir=C:\Program Files\ILLiad\ Result=1 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdStartCopy2-0] Result=1 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdFinish-0] Result=1 bOpt1=0 bOpt2=0uninstall.iss[{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-DlgOrder] Dlg0={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdWelcomeMaint-0 Count=3 Dlg1={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-MessageBox-0 Dlg2={40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdFinish-0 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdWelcomeMaint-0] Result=303 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-MessageBox-0] Result=6 [{40806BC2-67B3-4AF3-8D2C-50A11910CC72}-SdFinish-0] Result=1 bOpt1=0 bOpt2=0 Adam Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now