Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/13/2020 in all areas

  1. Nine

    pixelsearch on image

    You are missing a parenthesis ")". Look carefully the code I gave you. You need to have the right balance of parenthesis. Also there is not a color with 00000000, well it exists but I don't believe no one is using it. As the alpha part is 00, it is rarely use unless you want to create some transparency effect. The code you found is right. I was not trying to be rude when I asked you to provide code. But after few decades of programming, I know that computers are rarely wrong but humans ? Not so sure...
    2 points
  2. Trying to figure out how to do CallByName on AutoIt COM objects due to the lack of being able to set properties within an Execute() statement Several Ideas were Tried https://www.autoitscript.com/forum/topic/200129-set-object-properties-with-propertyname-and-value-taken-from-an-array/ I think this is the best; Patching the vtable of IDispatch so we can intercept a Fake function call ($obj.Au3_CallByName) use it like this Local $oDictionary = ObjCreate("Scripting.Dictionary") ; EXAMPLE Au3_CallByname_Init() ; (you can optionally provide a classname here but we patch the main Idispatch interface so really no need) $Au3_CallByName = "Add" ; Method we want to call $oDictionary.Au3_CallByName("Test", "Value") Au3_CallByname_Init(False) ; (Not Strictly Needed unhooked on exit) NOTE: Au3_CallByname_Init() doesn't have to be called at the top of the script, just call it before you need to call by name... Code + Example #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Au3CallByName, Bilgus Global $Au3_CallByName = 0 Local $hKernel32 = DllOpen("Kernel32.dll") OnAutoItExitRegister(__CallByNameCleanup) Func __CallByNameCleanup() Au3_CallByName_Init(False) ;Unload DllClose($hKernel32) EndFunc ;==>__CallByNameCleanup ; Takes a pointer to the v-table in a class and replaces specified member Id in it to a new one. Func __HookVTableEntry($pVtable, $iVtableOffset, $pHook, ByRef $pOldRet) ;;https://www.autoitscript.com/forum/topic/107678-hooking-into-the-idispatch-interface/ Local Const $PAGE_READWRITE = 0x04 Local $tpVtable = DllStructCreate("ptr", $pVtable) Local $szPtr = DllStructGetSize($tpVtable) Local $pFirstEntry, $pEntry, $tEntry, $aCall, $flOldProtect, $bStatus ; Dereference the vtable pointer $pFirstEntry = DllStructGetData($tpVtable, 1) $pEntry = $pFirstEntry + ($iVtableOffset * $szPtr) ; Make the memory free for all. Yay! $aCall = DllCall($hKernel32, "int", "VirtualProtect", "ptr", $pEntry, "long", $szPtr, "dword", $PAGE_READWRITE, "dword*", 0) If @error Or Not $aCall[0] Then ConsoleWriteError("Error: Failed To hook vTable" & @CRLF) Return False EndIf $flOldProtect = $aCall[4] $tEntry = DllStructCreate("ptr", $pEntry) $pOldRet = DllStructGetData($tEntry, 1) If $pOldRet <> $pHook Then DllStructSetData($tEntry, 1, $pHook) $bStatus = True Else ;Already Hooked ConsoleWriteError("Error: vTable is already hooked" & @CRLF) $bStatus = False EndIf ;put the memory protect back how we found it DllCall($hKernel32, "int", "VirtualProtect", "ptr", $pEntry, "long", $szPtr, "dword", $flOldProtect, "dword*", 0) Return $bStatus EndFunc ;==>__HookVTableEntry ; Everytime autoit wants to call a method, get or set a property in a object it needs to go to ; IDispatch::GetIDsFromNames. This is our version of that function, note that by defining this ourselves ; we can fool autoit to believe that the object supports a lot of different properties/methods. Func __IDispatch_GetIDsFromNames($pSelf, $riid, $rgszNames, $cNames, $lcid, $rgDispId) Local Const $CSTR_EQUAL = 0x02 Local Const $LOCALE_SYSTEM_DEFAULT = 0x800 Local Const $DISP_E_UNKNOWNNAME = 0x80020006 Local Static $pGIFN = __Pointer_GetIDsFromNames() Local Static $tpMember = DllStructCreate("ptr") If $Au3_CallByName Then Local $hRes, $aCall, $tMember ;autoit only asks for one member $aCall = DllCall($hKernel32, 'int', 'CompareStringW', 'dword', $LOCALE_SYSTEM_DEFAULT, 'dword', 0, 'wstr', "Au3_CallByName", 'int', -1, _ 'struct*', DllStructGetData(DllStructCreate("ptr[" & $cNames & "]", $rgszNames), 1, 1), 'int', -1) If Not @error And $aCall[0] = $CSTR_EQUAL Then ;ConsoleWrite("CallByName: " & $Au3_CallByName & @CRLF) $tMember = DllStructCreate("wchar[" & StringLen($Au3_CallByName) + 1 & "]") DllStructSetData($tMember, 1, $Au3_CallByName) DllStructSetData($tpMember, 1, DllStructGetPtr($tMember)) $rgszNames = $tpMember $Au3_CallByName = 0 EndIf EndIf ;Call the original GetIDsFromNames $hRes = DllCallAddress("LRESULT", $pGIFN, "ptr", $pSelf, "ptr", $riid, _ "struct*", $rgszNames, "dword", $cNames, "dword", $lcid, "ptr", $rgDispId) If @error Then ConsoleWrite("Error: GetIDsFromNames: " & @error & @CRLF) Return $DISP_E_UNKNOWNNAME EndIf Return $hRes[0] EndFunc ;==>__IDispatch_GetIDsFromNames Func __Pointer_GetIDsFromNames($ptr = 0) Local Static $pOldGIFN = $ptr If $ptr <> 0 Then $pOldGIFN = $ptr Return $pOldGIFN EndFunc ;==>__Pointer_GetIDsFromNames Func Au3_CallByName_Init($bHook = True, $classname = "shell.application") Local Const $iOffset_GetIDsFromNames = 5 Local Static $IDispatch_GetIDsFromNames_Callback = 0 Local $oObject, $pObject, $pHook, $pOldGIFN If $bHook Then If $IDispatch_GetIDsFromNames_Callback = 0 Then $IDispatch_GetIDsFromNames_Callback = DllCallbackRegister("__IDispatch_GetIDsFromNames", "LRESULT", "ptr;ptr;ptr;dword;dword;ptr") EndIf $pHook = DllCallbackGetPtr($IDispatch_GetIDsFromNames_Callback) Else $pHook = __Pointer_GetIDsFromNames() If $pHook <= 0 Then Return ;Already Unloaded EndIf $oObject = ObjCreate($classname) $pObject = DllStructSetData(DllStructCreate("ptr"), 1, $oObject) If __HookVTableEntry($pObject, $iOffset_GetIDsFromNames, $pHook, $pOldGIFN) Then __Pointer_GetIDsFromNames($pOldGIFN) ;Save the original pointer to GetIDsFromNames If Not $bHook Then DllCallbackFree($IDispatch_GetIDsFromNames_Callback) $IDispatch_GetIDsFromNames_Callback = 0 EndIf Else ;Error EndIf $oObject = 0 EndFunc ;==>Au3_CallByName_Init ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;TESTS; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Au3_CallByName_Init() #include <ie.au3> Global $oRegistrationInfo = _IECreate() Global $aRegistrationInfo[] = ['Left=10', 'Top= 10', 'Width=450', 'Height=600'] Global $oObject = $oRegistrationInfo Local $oDictionary = ObjCreate("Scripting.Dictionary") Local $oDictionary2 = ObjCreate("Scripting.Dictionary") ;Au3_CallByName_Init($oObject) __TS_TaskPropertiesSet($oObject, $aRegistrationInfo) MsgBox(0, "Info", "Press OK to exit") $oRegistrationInfo.quit $oRegistrationInfo = 0 $oObject = 0 Sleep(1000) For $i = 1 To 10 $Au3_CallByName = "Add" $oDictionary.Au3_CallByName("test1:" & $i, "Dictionary Item: " & $i) Next $Au3_CallByName = "keys" For $sKey In $oDictionary.Au3_CallByName() For $j = 0 To 1 $Au3_CallByName = ($j = 0) ? "Item" : "Exists" ConsoleWrite($sKey & " -> " & $oDictionary.Au3_CallByName($sKey) & @CRLF) Next Next Au3_CallByName_Init(False) ;Unload Au3_CallByName_Init() Local $aRegistrationInfo[] = ['Left=1000', 'Width=450'] ConsoleWrite(@CRLF & "NEW IE" & @CRLF & @CRLF) $oRegistrationInfo = _IECreate() __TS_TaskPropertiesSet($oRegistrationInfo, $aRegistrationInfo) MsgBox(0, "Info", "Press OK to exit") $oRegistrationInfo.quit For $i = 1 To 10 $Au3_CallByName = "Add" $oDictionary2.Au3_CallByName("test2:" & $i, "Dictionary Item: " & $i) Next $Au3_CallByName = "keys" For $sKey In $oDictionary2.Au3_CallByName() For $j = 0 To 1 $Au3_CallByName = ($j = 0) ? "Item" : "Exists" ConsoleWrite($sKey & " -> " & $oDictionary2.Au3_CallByName($sKey) & @CRLF) Next Next Au3_CallByName_Init(False) ;Unload (Not Strictly Needed, Done on Script Close) Func __TS_TaskPropertiesSet(ByRef $oObject, $aProperties) Local $aTemp If IsArray($aProperties) Then For $i = 0 To UBound($aProperties) - 1 $aTemp = StringSplit($aProperties[$i], "=", 2) ; 2 -> $STR_NOCOUNT) If @error Then ContinueLoop ConsoleWrite("Command: $oObject." & $aTemp[0] & " = " & $aTemp[1] & @CRLF) $Au3_CallByName = $aTemp[0] $oObject.Au3_CallByName = $aTemp[1] ConsoleWrite("Result : " & Hex(@error) & @CRLF) ; If @error Then Return SetError(1, @error, 0) Next EndIf EndFunc ;==>__TS_TaskPropertiesSet
    1 point
  3. I've a logical problem to understand how this will work properly. Let's say Test.exe is a x86 file but the AutoIt script is compiled as x64. My understanding is that the AutoIt script should execute the appropriate exe in MyProgram folder. In this case DllStructGetData($stType, 1) will return 0 (x86) but @ProgramFilesDir points to "C:\Program Files" the x64 folder because the AutoIt script is compiled as x64. But it should execute "C:\Program Files (x86)\MyProgram\x86.exe", shouldn't it? Example: #AutoIt3Wrapper_UseX64=y #include <WinAPIFiles.au3> _WinAPI_GetBinaryType("c:\Program Files (x86)\AutoIt3\Au3Info.exe") Switch @extended Case $SCS_32BIT_BINARY ConsoleWrite(EnvGet("ProgramFiles(x86)") & " <> " & @ProgramFilesDir & @CRLF) EndSwitch Btw, you can use _WinAPI_GetBinaryType too.
    1 point
  4. Not really sure why you have the first parameter in your function as it isn't required, I'd probably use somethine like: Global $g_sFilepath = @ScriptDir & "\Test.exe" ShellExecute(_TypeLocationRun($g_sFilepath), $g_sFilepath) Func _TypeLocationRun($_sFilepath) Local $stType = DllStructCreate("dword;") Local $aRet = DllCall("kernel32.dll", "hwnd", "GetBinaryType", "str", $_sFilepath, "ptr", DllStructGetPtr($stType)) Switch DllStructGetData($stType, 1) Case 0 Return @ProgramFilesDir & "\MyProgram\x86.exe" Case 6 Return @ProgramFilesDir & "\MyProgram\x64.exe" Case Else Return "" EndSwitch EndFunc ;==>_TypeLocationRun
    1 point
  5. Yep, those are the basics for what OP wants to achieve. I would be careful though with MouseGetPos in that it is only valid as long as the mouse moves. What if the mouse is clicked without moving or mouse wheel is used without moving ? If OP is fine with it, then MouseGetPos is not a bad solution. But to be honest, I think a hook is more robust as it will catch all activities on the mouse, whatever it is.
    1 point
  6. @ProgramFilesDir output depends on the Autoit script execution format. If you compile it as x86 then @ProgramFilesDir will be "C:\Program Files (x86)" otherwise as x64 "C:\Program Files". You cannot use for this purpose @ProgramFilesDir. I would suggest If StringInStr($FileBinType, "x86") Then $ProgramLocation = EnvGet("ProgramFiles(x86)") & "\MyProgram\x86.exe" Else $ProgramLocation = EnvGet("ProgramFiles") & "\MyProgram\x64.exe" EndIf
    1 point
  7. This somehow feels like it is directed to me. I thought I have been very clear with you ...right? I do not have the time at this moment to dive into the details of all the stuff you are rambling about and stated as such to you in PM with the suggestion to post it here. That you get these "calling this bullshit" responses is not something I planned for, but having said that it has been you that started with stating everything as facts instead of taking the smart approach and leaving room for people to correct you on your ideas. This was the last I say about this topic as I didn't want to get involved here anyways.... so never PM me again please! Jos *click* as this will only further deteriorate in a pissing contest.
    1 point
  8. Larsj's first response post should have been sufficient in my opinion. from there, instead of argument, you could have simply asked for some explanations and done some research.
    1 point
  9. @huud not sure why you joined an AutoIt language forum to post a PowerShell question?? I will say at the outset this is not how I would do it. It would be better practice to allow the user to choose the name of the parent and then use some agreed-upon naming convention for the children to keep things consistent. The way you have it, you're really not saving the end user any time from simply right-clicking manually and choosing new folder. That said, the code below works just fine for me. You should easily be able to capture the while loop into a function to cut down on repetition of lines. $path = [Environment]::GetFolderPath("Desktop") $newFolderName = Read-Host "Name for new folder" while (1) { try { New-Item -Path "$($path)\$($newFolderName)" -ItemType directory -ErrorAction Stop | Out-Null break } catch { $newFolderName = Read-Host "A folder named $($newFolderName) already exists in this directory, please choose another" } } $numFolders = Read-Host "Number of child folders" $numDaysLogged = Read-Host "Number of days logged" foreach ($a in 1..$numFolders) { $childFolderName = Read-Host "Name for child folder number $($a)" while (1) { try { New-Item -Path "$($path)\$($newFolderName)\$($childFolderName)" -ItemType directory -ErrorAction Stop | Out-Null break } catch { $childFolderName = Read-Host "A folder named $($childFolderName) already exists in this directory, please choose another" } } } beginning test... Name for new folder: Testing A folder named Testing already exists in this directory, please choose another: Testing A folder named Testing already exists in this directory, please choose another: Testing1 Number of child folders: 10 Number of days logged: 11 Name for child folder: Child1 Name for child folder: CHild1 A folder named CHild1 already exists in this directory, please choose another: Child2 Name for child folder: Child2 A folder named Child2 already exists in this directory, please choose another: Child3 Name for child folder: Child3 A folder named Child3 already exists in this directory, please choose another: Child4 Name for child folder: Child4 A folder named Child4 already exists in this directory, please choose another: Child5 Name for child folder: Child5 A folder named Child5 already exists in this directory, please choose another: Child6 Name for child folder: Child6 A folder named Child6 already exists in this directory, please choose another: Child7 Name for child folder: CHild7 A folder named CHild7 already exists in this directory, please choose another: Child8 Name for child folder: Child8 A folder named Child8 already exists in this directory, please choose another: Child9 Name for child folder: Child10
    1 point
  10. Bet you can figure it out on your own with a little effort. 😜
    1 point
  11. This may work. $sName = "douane" "//div[contains(text(), '" & $sName & "')]"
    1 point
  12. Seems you try to automate Outlook. My OutlookEX UDF (for download please see my signature) has a function to list attachments: _OL_ItemAttachmentGet.
    1 point
  13. There are situation when you know something is going off from or to your computer and you have no idea what that is or who's doing that. On the other hand, sometimes you are just curious to know (I know I am) what's cooking. Scrip below is analyzing every connection that your machine have. Either TCP or UDP. It'll give you port numbers, IP addresses, names of the processes issuing connections, their PIDs, locations on HD, user names, connection statuses, and hints on protocols for used ports (so that you know roughly what that connection is or could be). Also you will be given an ability to disable desired connection. Script: ConnView.au3 edit: new script
    1 point
  14. No... Like I said before, first figure out how to accomplish this (assuming it's even possible) using the browser's console. Then you should be able to convert that for use with _WD_ExecuteScript. Also, please stop with this stuff --> $sArguments="[]"[,$lAsync = False]. That's from the function header, which shows the proper syntax. The square brackets indicate that the parameter is optional. When calling the function, either leave out the parameter all together or supply an appropriate value. Some examples -- _WD_ExecuteScript($sSession,"$('#ypalliloi_panel:first-child').attr('id');") _WD_ExecuteScript($sSession,"$('#ypalliloi_panel:first-child').attr('id');", Default, False) _WD_ExecuteScript($sSession,"$('#ypalliloi_panel:first-child').attr('id');", "[]") Each one of these performs the exact same thing, since the 2nd and 3rd example simply supply the default value for the optional parameter. For examples of how to properly pass an element as a script argument, see _WD_SelectFiles and _WD_GetShadowRoot in wd_helper.au3.
    1 point
  15. Try this instead : #include <Misc.au3> HotKeySet("!q", "Terminate") HotKeySet("!s", "typeSelect") While 1 Sleep(100) WEnd Func Terminate() Exit EndFunc ;==>Terminate Func typeSelect() While _IsPressed ("12") Sleep (50) WEnd Send("select * from ") EndFunc
    1 point
  16. A funny way to work around (and BTW get a csv) #Include <Array.au3> $txt = "Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9" & @crlf & _ "784070 475086 2/21/2019 951612 774400 19 Some text Network Access Fee $9,818.00 $9,818.00" & @crlf & _ "321538 697220 10/16/2019 584345 157837 90 Some text Medical Supplies, DME $4,893.00 $4,893.00" & @crlf & _ "717049 131510 11/24/2019 591540 434357 80 Some text Hospital Costs $9,890.00 $9,890.00" & @crlf & _ "441658 578030 1/6/2019 920334 593618 92 Some text Network Access Fee $2,912.00 $2,912.00" & @crlf & _ "934772 726402 12/27/2019 262470 659210 41 Some text Network Access Fee $3,515.00 $3,515.00" & @crlf & _ "456371 782567 3/22/2019 232286 569047 76 Some text Bill Review $845.00 $845.00" & @crlf & _ "733793 243027 10/24/2019 827310 509902 30 Some text Physician Payment $9,401.00 $9,401.00" & @crlf & _ "446456 289749 12/14/2019 399924 975049 73 Some text Physical Therapy costs $5,212.00 $5,212.00" & @crlf & _ "657106 762255 6/13/2019 858558 157695 53 Some text Medical Payment $5,931.00 $5,931.00" & @crlf & _ "631262 523757 12/10/2019 221874 270665 85 Some text Medical Supplies, DME $592.00 $592.00" & @crlf & _ "705439 821105 7/9/2019 807562 429778 32 Some text Bill Review $1,802.00 $1,802.00" $p = '(?(DEFINE)' & _ '(?<NS>\d+)' & _ '(?<Date>\d{1,2}/\d{1,2}/\d{2,4})' & _ '(?<PaymentType>Pharmacy|Hospital Costs|Physical Therapy costs|Medical Payment|Physician Payment|Medical Supplies, DME|Bill Review|Network Access Fee|Chiropractic Expenses)' & _ '(?<Money>\$[\d,]*\.\d*))' & _ '(?im)^((?&NS)) ((?&NS)) ((?&Date)) ((?&NS)) ((?&NS)) (.+) ((?&PaymentType)) ((?&Money)) ((?&Money))' $s = StringRegExpReplace($txt, $p, "$5;$6;$7;$8;$9;${10};${11};${12};${13}") Msgbox(0,"", $s)
    1 point
  17. This was made for someone that was using FileInstall() wrong and asking for help. Since FileInstall() doesn't allow wildcards, and you must use a string for the source, this simply lets you choose a directory that you want to install, allows you to pick the extension to install or just use the wild card, allows you to choose the destination path, and allows you to choose the flag. It will bring everything up in the edit box, and you can use the copy button to copy the data, then paste it to your script. <snip> Feel free to add, critique, whatever... it was just thrown together quickly. Edit: Fixed version. Edit: Added the option to exclude the drive and directory from 1st parameter of FileInstall. Edit - 2014/12/02 Updated code... uses _FileListToArrayRec to allow recursive option now. Also goes to the computer location rather than homedrive. Note: Yes, there is a recursive option to get all the folders/files, however, I did not add code to check the directory paths and making sure they were created, this was a brain fart moment. But I do not have time at the moment to screw around with that, so if you want recursive and want to keep them installed in their directory paths, you may need to do each folder individually without recurse mode. <snip> Edit2 - 2014/12/02 I think I've fixed the recursion issue, added the choice of saving the hierarchy of the folder, should create the directories for you. I tried this on a huge folder of .au3 files, everything looked right. #include <GUIConstantsEx.au3> #include <File.au3> Global $sMyComputerCLSID = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" Global $gsDirData = "" Global $ghMain = GUICreate('FileInstall Directory', 600, 380) Global $giOutPut = GUICtrlCreateEdit('', 10, 10, 580, 300) GUICtrlCreateLabel('Extension:', 20, 318, 50, 20, 0x001) Global $giExtension = GUICtrlCreateInput('*', 75, 315, 50, 20) GUICtrlCreateLabel('Destination Path:', 130, 318, 90, 20, 0x001) Global $giDestPath = GUICtrlCreateInput('@TempDir & "\"', 220, 315, 200, 20) GUICtrlCreateLabel('Flag:', 425, 318, 30, 20, 0x001) Global $giFlag = GUICtrlCreateCombo('', 455, 315, 40, 300) GUICtrlSetData($giFlag, '0|1|', '0') Global $giDirDrive = GUICtrlCreateCheckbox("Long Path", 500, 315) Global $giDirRecurse = GUICtrlCreateCheckbox("Dir Recurse", 500, 335) Global $giDirHierarchy = GUICtrlCreateCheckbox("Keep Hierarchy", 500, 355) Global $giGetDir = GUICtrlCreateButton('Directory Get Files', 110, 345, 150, 30) Global $giCopyData = GUICtrlCreateButton('Copy Data', 320, 345, 150, 30) GUISetState() While 1 Switch GUIGetMsg() Case - 3 Exit Case $giGetDir $gsDirData = _GetDirData(GUICtrlRead($giExtension), (GUICtrlRead($giDirDrive) <> 1), _ GUICtrlRead($giDestPath), GUICtrlRead($giFlag), GUICtrlRead($giDirRecurse), _ GUICtrlRead($giDirHierarchy) = $GUI_CHECKED) If Not @error Then GUICtrlSetData($giOutPut, '') GUICtrlSetData($giOutPut, $gsDirData) EndIf Case $giCopyData ClipPut(GUICtrlRead($giOutPut)) EndSwitch WEnd Func _GetDirData($sExt, $bExcludeLongName, $sDestPath, $nFlag, $nRecursive, $bHierarchy) Local $sDir = FileSelectFolder("Select a Directory to FileInstall", $sMyComputerCLSID) If @error Then Return SetError(1, @extended, "") EndIf $nRecursive = ($nRecursive = $GUI_CHECKED) ? 1 : 0 Local $aFiles = _FileListToArrayRec($sDir, "*." & $sExt, 1, $nRecursive, 0, 2) If Not IsArray($aFiles) Then Return SetError(2, @extended, "") EndIf Local $sTDrive, $sTDir, $sTFName, $sTExt Local $sHold = "" _GetExistStr($sDestPath, $sHold) Local $sFinstall = "" Local $sTmpDest = "" Local $sHoldStr = "" If $bHierarchy Then ; main folder searching _PathSplit($sDir, $sTDrive, $sTDir, $sTFName, $sTExt) If StringRight(StringRegExpReplace($sDestPath, "[\\/]+\z", ""), _ StringLen($sTFName)) <> $sTFName Then $sTmpDest = StringRegExpReplace($sDestPath, _ "(\&\s*(?:\x27|\x22)[\\/]+(?:\x27|\x22))", "") & ' & "\' & $sTFName & '\"' If Not StringInStr($sHoldStr, $sTDir & @LF) Then $sHoldStr &= $sTDir & @LF _GetExistStr($sTmpDest, $sHold) EndIf EndIf EndIf Local Static $sScrDir = StringRegExpReplace(@ScriptDir, "\\+\z", "") For $i = 1 To UBound($aFiles) - 1 $sTmpDest = $sDestPath _PathSplit($aFiles[$i], $sTDrive, $sTDir, $sTFName, $sTExt) If $bExcludeLongName Then If $sScrDir = StringRegExpReplace($sTDrive & $sTDir, "\\+\z", "") Then $aFiles[$i] = $sTFName & $sTExt EndIf EndIf If $bHierarchy Then $sTmpDest = StringRegExpReplace($sTmpDest, _ "(\&\s*(?:\x27|\x22)[\\/]+(?:\x27|\x22))", "") & ' & "' & $sTDir & '"' If Not StringInStr($sHoldStr, $sTDir & @LF) Then $sHoldStr &= $sTDir & @LF _GetExistStr($sTmpDest, $sHold) EndIf EndIf $sFinstall &= "FileInstall(""" & $aFiles[$i] & '", ' & $sTmpDest & ", " & $nFlag & ")" & @CRLF Next $sHold &= $sFinstall $sHold = StringTrimRight($sHold, 2) Return $sHold EndFunc Func _GetExistStr($sDestPath, ByRef $sOutData) $sOutData &= 'If Not FileExists(' & $sDestPath & ') Then' & @CRLF $sOutData &= ' Do' & @CRLF $sOutData &= ' DirCreate(' & $sDestPath & ')' & @CRLF $sOutData &= ' Until FileExists(' & $sDestPath & ')' & @CRLF $sOutData &= 'EndIf' & @CRLF EndFunc .
    1 point
  18. Well you're in a real contentious mood today, aren't ya. I posted it in the AutoIT help section. If it ended up in a different section, maybe there's an issue with the site. But I think JLogan3o13 was probably just mistaken when thought he saw it in the Developer General Discussion area. It would be better if you did not directly contradict your forum users like that, please. Give us the benefit of the doubt, that perhaps we might actually be in a better position to know what we did, better than you do. I'm not trying to personally attack you or anyone. But it feels like you personally attacked me, so I'm getting defensive. You can choose not to believe me- fine. But please don't just flat out contradict me about something that I'm actually in a better position to know about. You need to consider that the moderators and developers on this site are just as capable of mistakes or having wrong information as we are. Again, thanks for the help everyone.
    0 points
×
×
  • Create New...