DickG Posted February 27, 2016 Share Posted February 27, 2016 I recently upgraded SciTE to v15.920.938.0. Now when I run a script that displays MsgBoxes and GUIs, using Stop Executing no longer closes all open dialogs. It used to before I upgraded. But I can't find any info in the SciTE forum or browsing SciTEGlobal.properties. I've tried the HotKeySet("{Esc}", "ExitScript") trick by calling Func ExitScript(), but that doesn't stop the script when there are open dialogs. I'd like to get the Stop Executing command to work like it used to. Before I revert back to the previous SciTE (v14.1.2.21), I'd like to see if anyone knows how to fix this. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 (edited) Not sure what you trying to do that isn't working anymore or changed in latest version of SciTE/Atot3Wrapper behavior. Can you post a replicator script to demonstrate the issue? Jos Edited February 27, 2016 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 25 minutes ago, Jos said: Not sure what you trying to do that isn;t working or changed in SciTE. Can you post a replicator script to demonstrate the issue? Jos Try this: expandcollapse popup#Region: Include Local $Left, $Top, $Btn_H, $Gui_Main_W, $Gui_Main_H, $GUI_Main, $Child_btn, $Gui_Main_B, $OK_btn, $Cancel_btn #Endregion #Region: Run GUI_Main() GUI_Loop() #EndRegion #Region: GUI_Main Func GUI_Main() Local $ThisFunc = "GUI_Main" ;Define GUI size/position variables. $Left = 150 $Top = 150 $Btn_H = 25 $Gui_Main_W = 435 $Gui_Main_H = 215 $GUI_Main = GUICreate("GUI Main", $Gui_Main_W, $Gui_Main_H, $Top, $Left, $Btn_H) $Gui_Main_B = $Gui_Main_H - 20 ;OK_button [L, T, W, H]. $OK_btn = GuiCtrlCreateButton("OK", ($Gui_Main_W - 50)/2, $Gui_Main_B - 85, 60, $Btn_H) ;Cancel_button [L, T, W, H]. $Cancel_btn = GuiCtrlCreateButton("Cancel", ($Gui_Main_W - 50)/2, $Gui_Main_B - 55, 60, $Btn_H) Return EndFunc #EndRegion #Region: GUI_Loop Func GUI_Loop() Local $ThisFunc = "GUI_Loop" GUISetState(@SW_SHOW, $GUI_Main) MsgBox(0, $ThisFunc, "Now use Stop Executing." & @CR & _ "You'll notice that this MsgBox remains open.") MsgBox(0, $ThisFunc, "And the script continues to this!") While 1 $Msg = GUIGetMsg() Switch $Msg Case $Cancel_btn Exit EndSwitch WEnd EndFunc #EndRegion Another annoying thing I found is that when I open another script from any location, it opens in the same SciTE instance that I have open. The previous version didn't do that. It would open it in a new SciTE instance. There must be some setting that manages this, but I can't find it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 27, 2016 Moderators Share Posted February 27, 2016 (edited) DickG, I can help you with that last point - add "check.if.already.open=0" to your user options file. Although opening a new file in the same instance has been the default for as far back as I can remember. M23 Edit: And having now tried your script above - the MsgBox closes for me when using "Stop Executing", just as I expected. Edited February 27, 2016 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 5 minutes ago, Melba23 said: DickG, I can help you with that last point - add "check.if.already.open=0" to your user options file. Although opening a new file in the same instance has been the default for as far back as I can remember. M23 Edit: And having now tried your script above - the MsgBox closes for me when using "Stop Executing", just as I expected. OK, thanks much for the check.if.already.open=0 setting, Melba. But what do you think is preventing Stop Executing for me, but works for you? It must have something to do with the newer SciTE version, I would think. It always stopped the script and closed everything that was open before. Any idea? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 Can you show the SciTE output pane information when you run the script to see whether that tells me something? 51 minutes ago, DickG said: Another annoying thing I found is that when I open another script from any location, That is called a feature, which is configurable as Melba23 stated! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 2 minutes ago, Jos said: Can you show the SciTE output pane information when you run the script to see whether that tells me something? That is called a feature, which is configurable as Melba23 stated! Jos Sorry, but I don't know what the SciTE output pane is. I tried finding that in the SciTE Help and in the SciTE menus, but didn't find anything. Is that the same as the SciTE console? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 The bottom portion in SciTE where the console information is shown when you hit F5/Run. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 2 minutes ago, Jos said: The bottom portion in SciTE where the console information is shown when you hit F5/Run. Jos OK, I've only known it as "the console". It doesn't show anything because I haven't written anything to the console for this. But this is all it shows: >"C:\Program Files\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\My Documents\My Programs\Bookmarks Manager\Bookmarks Manager.au3" /UserParams +>15:02:33 Starting AutoIt3Wrapper v.0.0.0.0 SciTE v.3.6.0.0 ; Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86 Environment(Language:0409 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86) >Running AU3Check (3.3.14.2) from:C:\Program Files\AutoIt3 +>15:02:35 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\My Documents\My Programs\Bookmarks Manager\Bookmarks Manager.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop +>15:02:59 AutoIt3.exe ended.rc:0 +>15:02:59 AutoIt3Wrapper Finished.. >Exit code: 0 Time: 25.73 I hope this is what you mean. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 Could you try downloading and replacing the latest Beta version of AutoIt3Wrapper.au3 and test & Show the output again? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 2 minutes ago, Jos said: Could you try downloading and replacing the latest Beta version of AutoIt3Wrapper.au3 and test & Show the output again? Jos Hmmm ... I thought I had the latest version. The AutoIt3Wrapper.exe that came with shows v2.1.4.4. That's what came with SciTE4AutoIt3 v15.920.938.0.exe. Is that the latest? Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 Whoops! Sorry, I just realized you said the "Beta" version. OK, I'll try that. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 Correct https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/AutoIt3Wrapper.au3 Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 2 minutes ago, Jos said: Correct https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/AutoIt3Wrapper.au3 Jos OK, that works! Interesting. The console shows this: >"C:\Program Files\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\My Documents\My Programs\Testing\GUIs\Nested GUIs\GUI_Test_for AutoIt Forum.au3" /UserParams +>15:29:53 Starting AutoIt3Wrapper v.15.920.938.6 SciTE v.3.6.0.0 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X64 OS:X86 Environment(Language:0409) CodePage:0 utf8.auto.check:4 # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM +> SciTEDir => C:\Program Files\AutoIt3\SciTE UserDir => C:\Documents and Settings\Administrator.P2800\Local Settings\Application Data\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Documents and Settings\Administrator.P2800\Local Settings\Application Data\AutoIt v3\SciTE >Running AU3Check (3.3.14.2) from:C:\Program Files\AutoIt3 input:D:\My Documents\My Programs\Testing\GUIs\Nested GUIs\GUI_Test_for AutoIt Forum.au3 +>15:29:53 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "D:\My Documents\My Programs\Testing\GUIs\Nested GUIs\GUI_Test_for AutoIt Forum.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop >Process failed to respond; forcing abrupt termination... >Exit code: 1 Time: 6.127 The GUI is hard to read. The controls overlap, and the GUI itself is too narrow, so it cuts off the title bar. I had modified the GUI controls to use wider and taller labels and pushed some labels off to the right a bit so it doesn't bump into the label on the left. See attached. The original is on the left. I had adjusted it just today so I could read everything when compiling. The tweaked GUI is on the right. Maybe it's my screen resolution. I'm using 1600 x 900 on a 22" screen. I also have a 55" Samsung TV that I also run my scripts on (used as only a monitor, not a "TV"). I've had to make adjustments so my scripts look good on both systems. It's a bit tricky to do, but I came up with way to do it. It works 95% of the time. But I can share that if you like. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 Sure, send me your version and I will have a look to see if that also works for me. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 14 minutes ago, Jos said: Sure, send me your version and I will have a look to see if that also works for me. Jos OK, I just made the changes again. I used WinMerge to compare old to new and went line by line. It's all in the GUI_Show() function. expandcollapse popupFunc GUI_Show() ; GUI Definition ;------------------------------------------------------------------------------------------- ;~ Local $H_Comment, $H_Description, $H_Fileversion, $H_Fileversion_AutoIncrement_n, $H_Fileversion_AutoIncrement_p, $H_Fileversion_AutoIncrement_y ;~ local $H_LegalCopyright, $H_FieldNameEdit, $H_Res_Language Opt("GUICoordMode", 1) GUICreate("AutoIt3Wrapper GUI to Compile AutotIt3 Script (ver " & $VERSION & ")", 700, 525, (@DesktopWidth - 650) / 2, (@DesktopHeight - 500) / 2) GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') Local $h_File = GUICtrlCreateMenu("&File") Local $h_Exit = GUICtrlCreateMenuItem("&Exit", $h_File) Local $h_Help = GUICtrlCreateMenu("&Help") Local $h_HelpFile = GUICtrlCreateMenuItem("&Help", $h_Help) Local $h_About = GUICtrlCreateMenuItem("&About", $h_Help) Local $Init_Dir, $tempval Local $szDrive, $szDir, $szFName, $szExt Local $tab = GUICtrlCreateTab(10, 10, 630, 430) ;========================================================================================================================================= Local $tab0 = GUICtrlCreateTabItem("AutoIt3/Aut2Exe") GUICtrlCreateLabel("AutoIt3 version to use:", 30, 60, 110, 40) GUIStartGroup() Local $H_AUTOIT3_Version_P = GUICtrlCreateRadio("Production:", 150, 57) Local $H_AUTOIT3_Version_B = GUICtrlCreateRadio("Beta:", 150, 77) Local $MainAutoIt_InstallDir ; If StringRight($CurrentAutoIt_InstallDir, 5) = "\Beta" Then $MainAutoIt_InstallDir = StringTrimRight($CurrentAutoIt_InstallDir, 5) Else $MainAutoIt_InstallDir = $CurrentAutoIt_InstallDir EndIf ; File AutoItSC.bin doesn't exists as of v 3.3.9.5 If FileExists($MainAutoIt_InstallDir & "\aut2exe\AutoItSC.bin") Then GUICtrlCreateLabel("Ver: " & FileGetVersion($MainAutoIt_InstallDir & "\aut2exe\AutoItSC.bin"), 260, 60, 100, 25) Else GUICtrlCreateLabel("Ver: " & FileGetVersion($MainAutoIt_InstallDir & "\aut2exe\Aut2exe.exe"), 260, 60, 100, 25) EndIf If FileExists($MainAutoIt_InstallDir & "\beta\aut2exe\AutoItSC.bin") Then GUICtrlCreateLabel("Ver: " & FileGetVersion($MainAutoIt_InstallDir & "\Beta\aut2exe\AutoItSC.bin"), 260, 80, 100, 25) Else GUICtrlCreateLabel("Ver: " & FileGetVersion($MainAutoIt_InstallDir & "\Beta\aut2exe\Aut2exe.exe"), 260, 80, 100, 25) EndIf If $INP_AutoIt3_Version = "Beta" Then GUICtrlSetState($H_AUTOIT3_Version_B, $GUI_CHECKED) Else GUICtrlSetState($H_AUTOIT3_Version_P, $GUI_CHECKED) EndIf ; GUICtrlCreateLabel("Source: ", 30, 105, 65, 20, $SS_RIGHT) GUICtrlCreateLabel($ScriptFile_In, 100, 105, 500, 20, BitOR($WS_BORDER, $SS_LEFTNOWORDWRAP, $SS_NOPREFIX)) ; GUICtrlCreateLabel("Output type: ", 30, 130, 65, 20, $SS_RIGHT) GUIStartGroup() Local $H_Out_Type_e = GUICtrlCreateRadio("EXE", 100, 130, 50, 25) Local $H_Out_Type_a = GUICtrlCreateRadio("A3X", 160, 130, 50, 25) GUIStartGroup() If $ScriptFile_Out_Type = "a3x" Then GUICtrlSetState($H_Out_Type_a, $GUI_CHECKED) Else GUICtrlSetState($H_Out_Type_e, $GUI_CHECKED) EndIf ; GUICtrlCreateLabel("Target x86: ", 30, 155, 65, 20, $SS_RIGHT) ;$ScriptFile_Out = DirGetRelativePath($ScriptFile_In,$ScriptFile_Out) Local $H_SCRIPTFILE_OUT = GUICtrlCreateInput($ScriptFile_Out, 100, 155, 440, 20) Local $H_SCRIPTFILE_OUT_CHANGE = GUICtrlCreateButton("...", 542, 155, 40, 20) GUICtrlCreateLabel("Target x64:", 30, 180, 65, 20, $SS_RIGHT) Local $H_SCRIPTFILE_OUT_X64 = GUICtrlCreateInput($ScriptFile_Out_x64, 100, 180, 440, 20) Local $H_SCRIPTFILE_OUT_CHANGE_X64 = GUICtrlCreateButton("...", 542, 180, 40, 20) ; GUICtrlCreateLabel("Icon:", 30, 207, 65, 20, $SS_RIGHT) Local $H_INP_ICON_ICO = 0 Local $AutoIt_Icon = RegRead("HKCR\AutoIt3Script\DefaultIcon", "") Local $AutoIt_Icon_Dir = StringLeft($AutoIt_Icon, StringInStr($AutoIt_Icon, "\", 0, -1)) If FileExists($INP_Icon) Or FileExists($AutoIt_Icon_Dir & $INP_Icon) Then $H_INP_ICON_ICO = GUICtrlCreateIcon($INP_Icon, Default, 545, 230) Else ConsoleWrite("->Icon not found:" & _PathFull($INP_Icon) & @CRLF) EndIf ;$INP_Icon = DirGetRelativePath($ScriptFile_In,$INP_Icon) Local $H_INP_ICON = GUICtrlCreateEdit($INP_Icon, 100, 205, 440, 20) Local $H_INP_ICON_CHANGE = GUICtrlCreateButton("...", 542, 205, 40, 20) ; ; GUICtrlCreateLabel("FileInstall Compression:", 20, 235, 120, 20) ;, $SS_RIGHT) Local $H_Compression = GUICtrlCreateCombo("", 142, 232, 170, 80, $CBS_DROPDOWNLIST) Local $INP_W_Compression = "Normal" If $INP_Compression = 0 Then $INP_W_Compression = "Lowest" If $INP_Compression = 1 Then $INP_W_Compression = "Low" If $INP_Compression = 2 Then $INP_W_Compression = "Normal" If $INP_Compression = 3 Then $INP_W_Compression = "High" If $INP_Compression = 4 Then $INP_W_Compression = "Highest" GUICtrlSetData($H_Compression, "Lowest|Low|Normal|High|Highest", $INP_W_Compression) ; ;~ Global $H_AUTOIT3_Ansi = GUICtrlCreateCheckbox("Use ANSI version of AutoIt3/Aut2Exe (Only works up till AutoIt3 v 3.2.12.0", 100, 230) ;~ If $INP_UseAnsi = "y" Then GUICtrlSetState($H_AUTOIT3_Ansi, $GUI_CHECKED) ; ;~ Global $H_AUTOIT3_X64 = GUICtrlCreateCheckbox("Use X64 version of AutoIt3/Aut2Exe", 100, 255) ;~ If $INP_UseX64 = "y" Then GUICtrlSetState($H_AUTOIT3_X64, $GUI_CHECKED) GUICtrlCreateLabel("Output arch:", 30, 265, 70, 50) GUIStartGroup() ;~ Global $H_AUTOIT3_X86 = GUICtrlCreateRadio("Use X86 version.", 100, 255) ;~ Global $H_AUTOIT3_X64 = GUICtrlCreateRadio("Use X64 version.", 100, 272) Local $H_AUTOIT3_X86 = GUICtrlCreateCheckbox("Compile X86 version. (default)", 100, 255, 250, 25) Local $H_AUTOIT3_X64 = GUICtrlCreateCheckbox("Compile X64 version.", 100, 280, 250, 25) If $INP_UseX64 = "y" Then GUICtrlSetState($H_AUTOIT3_X64, $GUI_CHECKED) Else GUICtrlSetState($H_AUTOIT3_X86, $GUI_CHECKED) EndIf If $INP_Compile_Both = "y" Then GUICtrlSetState($H_AUTOIT3_X64, $GUI_CHECKED) GUICtrlSetState($H_AUTOIT3_X86, $GUI_CHECKED) EndIf ; Local $H_AUTOIT3_Upx = GUICtrlCreateCheckbox("Use UPX", 100, 305) If $INP_UseUpx = "y" Then GUICtrlSetState($H_AUTOIT3_Upx, $GUI_CHECKED) ; Local $H_Change2CUI = GUICtrlCreateCheckbox("Create CUI instead of GUI EXE.", 100, 330) If $INP_Change2CUI = "y" Then GUICtrlSetState($H_Change2CUI, $GUI_CHECKED) ; Local $H_Add_Constants = GUICtrlCreateCheckbox("Add required Constants*.au3 to your script.", 100, 355) If $INP_Add_Constants = "y" Then GUICtrlSetState($H_Add_Constants, $GUI_CHECKED) ; Help info GUICtrlSetTip($H_SCRIPTFILE_OUT, "Specify when a different outputfile is wanted. Default: scriptname.exe.") ;~ GUICtrlSetTip($H_INP_NODECOMPILE, "UNCheck to compile with a Random password.") GUICtrlSetTip($H_Compression, "Compression level used on the FileInstall() included files.") ;~ GUICtrlSetTip($H_AUTOIT3_Ansi, "Check to compile with the Ansi version when Win9x/Me support is needed.") GUICtrlSetTip($H_AUTOIT3_X86, "Check to compile with the X86 version of AutoIt3.") GUICtrlSetTip($H_AUTOIT3_X64, "Check to compile with the X64 version of AutoIt3.") GUICtrlSetTip($H_AUTOIT3_Upx, "Check to run UPX on the Output EXE.") GUICtrlSetTip($H_Add_Constants, "This will add all required Constands*.au3 includes to your Script. It will only run one time.") ;========================================================================================================================================= Local $tab1 = GUICtrlCreateTabItem("Resource Update") ; resource info Local $H_Res_L01 = GUICtrlCreateLabel("Comment:", 30, 60, 65, 20, $SS_RIGHT) $H_Comment = GUICtrlCreateInput($INP_Comment, 100, 45, 500, 35, 0x0004) ; Local $H_Res_L02 = GUICtrlCreateLabel("Description:", 30, 87, 65, 20, $SS_RIGHT) $H_Description = GUICtrlCreateInput($INP_Description, 100, 85, 500, 20) If $INP_Fileversion <> "" Then $INP_Fileversion = Valid_FileVersion($INP_Fileversion) Local $H_Res_L03 = GUICtrlCreateLabel("FileVersion:", 30, 112, 65, 20, $SS_RIGHT) $H_Fileversion = GUICtrlCreateInput($INP_Fileversion, 100, 110, 100, 20) ; $H_Fileversion_AutoIncrement_n = GUICtrlCreateRadio("Don't Auto Increment.", 210, 110, Default, Default, $WS_GROUP) $H_Fileversion_AutoIncrement_y = GUICtrlCreateRadio("Auto Increment", 340, 110) $H_Fileversion_AutoIncrement_p = GUICtrlCreateRadio("Prompt to Auto Increment", 450, 110) Switch $INP_Fileversion_AutoIncrement Case "y" GUICtrlSetState($H_Fileversion_AutoIncrement_y, $GUI_CHECKED) Case "p" GUICtrlSetState($H_Fileversion_AutoIncrement_p, $GUI_CHECKED) Case Else GUICtrlSetState($H_Fileversion_AutoIncrement_n, $GUI_CHECKED) EndSwitch ; Local $H_Res_L04 = GUICtrlCreateLabel("LegalCopyright:", 21, 140, 74, 20, BitOR($SS_RIGHT, $WS_GROUP)) $H_LegalCopyright = GUICtrlCreateInput($INP_LegalCopyright, 100, 135, 500, 20) ; Local $H_Res_L05 = GUICtrlCreateLabel("Language:", 21, 165, 74, 20, $SS_RIGHT) $H_Res_Language = GUICtrlCreateCombo("", 100, 160, 500, 20, $CBS_DROPDOWNLIST) Local $CountryTable, $Country Language_Code($INP_Res_Language, $CountryTable, $Country, 1) GUICtrlSetData(-1, $CountryTable, $Country) ; add other item snd set a new default Local $INP_FieldNameEdit = "" For $U = 1 To $INP_Res_FieldCount $INP_FieldNameEdit &= $INP_FieldName[$U] & " = " & $INP_FieldValue[$U] & @CRLF Next ; "asInvoker", "highestAvailable", "requireAdministrator" Local $H_Res_L06 = GUICtrlCreateLabel("RequestedExecutionLevel:", 21, 189, 76, 20, $SS_RIGHT) Local $H_Res_requestedExecutionLevel_d = GUICtrlCreateRadio("Default", 105, 186, Default, Default, $WS_GROUP) Local $H_Res_requestedExecutionLevel_a = GUICtrlCreateRadio("asInvoker", 160, 186) Local $H_Res_requestedExecutionLevel_h = GUICtrlCreateRadio("highestAvailable", 235, 186) Local $H_Res_requestedExecutionLevel_r = GUICtrlCreateRadio("requireAdministrator", 335, 186) Local $H_Res_requestedExecutionLevel_n = GUICtrlCreateRadio("None", 450, 186) Switch $INP_Res_requestedExecutionLevel Case "None" GUICtrlSetState($H_Res_requestedExecutionLevel_n, $GUI_CHECKED) Case "asInvoker" GUICtrlSetState($H_Res_requestedExecutionLevel_a, $GUI_CHECKED) Case "highestAvailable" GUICtrlSetState($H_Res_requestedExecutionLevel_h, $GUI_CHECKED) Case "requireAdministrator" GUICtrlSetState($H_Res_requestedExecutionLevel_r, $GUI_CHECKED) Case Else GUICtrlSetState($H_Res_requestedExecutionLevel_d, $GUI_CHECKED) EndSwitch ; Local $H_Res_L07 = GUICtrlCreateLabel("Extra resource Fields:", 11, 230, 74, 40, BitOR($SS_RIGHT, $WS_GROUP)) $H_FieldNameEdit = GUICtrlCreateEdit($INP_FieldNameEdit, 100, 210, 500, 180) ; Local $H_Res_SaveSource = GUICtrlCreateCheckbox("Save a copy of the Scriptsource in the output program resources.", 100, 395) If $INP_Res_SaveSource = "y" Then GUICtrlSetState($H_Res_SaveSource, $GUI_CHECKED) ; ;========================================================================================================================================= Local $tab1b = GUICtrlCreateTabItem("Res Add Files") Local $H_Res_L08 = GUICtrlCreateLabel("Extra Icons:", 11, 80, 74, 40, $SS_RIGHT) Local $INP_Icons_txt = "" For $x = 1 To $INP_Icons_cnt $INP_Icons_txt &= $INP_Icons[$x] & @CRLF Next Local $H_Icons = GUICtrlCreateEdit($INP_Icons_txt, 100, 60, 500, 160) Local $H_Res_L09 = GUICtrlCreateLabel("Extra Files:", 11, 250, 74, 40, $SS_RIGHT) ; Local $Inp_Res_Files_txt = "" For $x = 1 To $INP_Res_Files_Cnt $Inp_Res_Files_txt &= $INP_Res_Files[$x] & @CRLF Next Local $H_Res_Files = GUICtrlCreateEdit($Inp_Res_Files_txt, 100, 230, 500, 160) GUICtrlSetTip($H_Res_L06, "Specify the RequestedExecutionLevel to be set in the Program Manifest.") GUICtrlSetTip($H_Res_requestedExecutionLevel_d, "Use the default from AUT2EXE setting in the Program Manifest.") GUICtrlSetTip($H_Res_requestedExecutionLevel_a, "Specify the RequestedExecutionLevel to be set in the Program Manifest.") GUICtrlSetTip($H_Res_requestedExecutionLevel_h, "Specify the RequestedExecutionLevel to be set in the Program Manifest.") GUICtrlSetTip($H_Res_requestedExecutionLevel_r, "Specify the RequestedExecutionLevel to be set in the Program Manifest.") GUICtrlSetTip($H_Res_requestedExecutionLevel_n, "Remove the current RequestedExecutionLevel from the Program Manifest set by AUT2EXE.") GUICtrlSetTip($H_FieldNameEdit, 'Add extra Resource info. One per line.' & @CRLF & 'Syntax: Fieldname = Description.' & @CRLF & 'Example:Made By = Jos van der Zande') GUICtrlSetTip($H_Res_L07, 'Add extra Resource info. One per line.' & @CRLF & 'Syntax: Fieldname = Description.' & @CRLF & 'Example:Made By = Jos van der Zande') GUICtrlSetTip($H_Icons, "Specify additional Icons to be included in the programs resources." & @CRLF & "One file per line." & @CRLF & "(F1-see helpfile for details)") GUICtrlSetTip($H_Res_L09, "Specify additional Files to be included in the programs resources." & @CRLF & "One file per line. Format: Filename[,Section [,ResName]]" & @CRLF & "(F1-see helpfile for details)") GUICtrlSetTip($H_Res_Files, "Specify additional Files to be included in the programs resources." & @CRLF & "One file per line. Format: Filename[,Section [,ResName]]" & @CRLF & "(F1-see helpfile for details)") ;================================================================================================================================= Local $tab2 = GUICtrlCreateTabItem("Run Before/After") ; run before program GUICtrlCreateLabel("Specify here the commands to run before and after the Compilation process.", 50, 60, 500, 20) GUICtrlCreateLabel("Run before :", 30, 100, 65, 20, $SS_RIGHT) Local $txt_INP_Run_Before For $x = 1 To $INP_Run_Before[0] If $INP_Run_Before[$x] <> "" Then $txt_INP_Run_Before &= $INP_Run_Before[$x] If Not ($x = $INP_Run_Before[0]) Then $txt_INP_Run_Before &= @CRLF EndIf Next Local $H_Run_Before = GUICtrlCreateEdit($txt_INP_Run_Before, 100, 85, 445, 80) GUICtrlCreateLabel("Run after :", 30, 200, 65, 20, $SS_RIGHT) Local $txt_INP_Run_After For $x = 1 To $INP_Run_After[0] If $INP_Run_After[$x] <> "" Then $txt_INP_Run_After &= $INP_Run_After[$x] If Not ($x = $INP_Run_After[0]) Then $txt_INP_Run_After &= @CRLF EndIf Next Local $H_Run_After = GUICtrlCreateEdit($txt_INP_Run_After, 100, 170, 445, 80) Local $temp = "These commands will be executed one at a time as cmdline commands. " & @CRLF & _ 'The Commandlines can contain the following variables:' & @CRLF & _ ' %in% , %out%, %outx64%, %icon% which will be replaced by the fullpath\filename.' & @CRLF & _ ' %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.' & @CRLF & _ ' %fileversion% set to the #AutoIt3Wrapper_Res_Fileversion directive value.' & @CRLF & _ ' %scitedir% will be replaced by the SciTE program directory' & @CRLF & _ 'Examples:' & @CRLF & _ ' copy "%in%" "c:\program files\autoit3\SciTE\AutoIt3Wrapper"' & @CRLF & _ ' copy "%out%" "c:\program files\autoit3\SciTE\AutoIt3Wrapper"' & @CRLF & _ ' start aacopy.bat "%out%" "C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper"' GUICtrlCreateEdit($temp, 20, 260, 600, 170, $ES_READONLY) GUICtrlSetFont(-1, Default, Default, Default, "Courier New") GUICtrlSetTip($H_Run_Before, "Specify the command(s), one on each line, to be executed before compilation.") GUICtrlSetTip($H_Run_After, "Specify the command(s), one on each line, to be executed after compilation.") ;================================================================================================================================= Local $tab3 = GUICtrlCreateTabItem("Au3Check") ; Run au3Check before compilation? GUICtrlCreateLabel("Au3Check Version: " & FileGetVersion($CurrentAutoIt_InstallDir & "\Au3check.exe"), 400, 50, 180, 20, $SS_RIGHT) Local $H_Run_AU3Check = GUICtrlCreateCheckbox("Run AU3Check before compilation.", 100, 65, 250, 20) If $INP_Run_AU3Check = "y" Then GUICtrlSetState($H_Run_AU3Check, $GUI_CHECKED) If $INP_Add_Constants = "y" Then GUICtrlSetState($H_Add_Constants, $GUI_CHECKED) Local $H_AU3Check_Stop_OnWarning = GUICtrlCreateCheckbox("Also stop on warnings", 100, 90, 250, 20) If $INP_AU3Check_Stop_OnWarning = "y" Then GUICtrlSetState($H_AU3Check_Stop_OnWarning, $GUI_CHECKED) GUICtrlCreateLabel("Skip Plugin Func(s):", 30, 115, 120, 20, $SS_RIGHT) Local $H_AU3Check_Plugin = GUICtrlCreateInput($INP_Au3check_Plugin, 155, 113, 390, 20) GUICtrlCreateLabel("Au3Check Parameters :", 30, 145, 120, 20, $SS_RIGHT) Local $H_AU3Check_Parameters = GUICtrlCreateInput($INP_AU3Check_Parameters, 155, 143, 390, 20) $temp = "Possible Parameters: " & @CRLF & _ ' -q : quiet (only error/warn output)' & @CRLF & _ ' -d : as Opt("MustDeclareVars", 1)' & @CRLF & _ ' -I dir : additional directories for searching include files' & @CRLF & _ ' -U -|file : output unreferenced UDFs and global variables' & @CRLF & _ ' -w 1 : already included file (on)' & @CRLF & _ ' -w 2 : missing #comments-end (on)' & @CRLF & _ ' -w 3 : already declared var (off)' & @CRLF & _ ' -w 4 : local var used in global scope (off)' & @CRLF & _ ' -w 5 : local var declared but not used (off)' & @CRLF & _ ' -w 6 : warn when using Dim (off)' & @CRLF & _ ' -v 1 : show include paths/files (off)' & @CRLF & _ ' -v 2 : show lexer tokens (off)' GUICtrlCreateEdit($temp, 20, 180, 600, 240, $ES_READONLY) GUICtrlSetFont(-1, Default, Default, Default, "Courier New") GUICtrlSetTip($H_Run_AU3Check, "Run Au3Check to check your source for possible problems.") GUICtrlSetTip($H_AU3Check_Stop_OnWarning, "Also stop when Au3Check detects warnings." & @CRLF & "Normal behaviour is to continue.") ;================================================================================================================================= Local $tab4 = GUICtrlCreateTabItem("Tidy") ; Run Tidy ? GUICtrlCreateLabel("Tidy Version: " & FileGetVersion($SciTE_Dir & "\Tidy\Tidy.exe"), 400, 50, 180, 20, $SS_RIGHT) Local $H_Run_Tidy = GUICtrlCreateCheckbox("Run Tidy before compilation.", 100, 65, 250, 20) If $INP_Run_Tidy = "y" Then GUICtrlSetState($H_Run_Tidy, $GUI_CHECKED) ; Local $H_Tidy_Stop_OnError = GUICtrlCreateCheckbox("Stop on Tidy Errors", 100, 90, 250, 20) If $INP_Tidy_Stop_OnError = "y" Then GUICtrlSetState($H_Tidy_Stop_OnError, $GUI_CHECKED) ; GUICtrlCreateLabel("Tidy Parameters :", 30, 115, 120, 20, $SS_RIGHT) Local $H_Tidy_Parameters = GUICtrlCreateInput($INP_Tidy_Parameters, 155, 113, 390, 20) $temp = "Possible Parameters: " & @CRLF & _ " /tc n : 0=Tab >0=Number of Spaces." & @CRLF & _ " /gd : Generate documentation file." & @CRLF & _ " /rel : Remove empty lines from the source." & @CRLF & _ " /sci 0 : Default Minimal output to the console: warning and errors." & @CRLF & _ " /sci 1 : Show more progress information. " & @CRLF & _ " /sci 9 : Show all debug lines as found in the Obfuscator.log." & @CRLF & _ " /gds : Show generated doc file in Notepad." & @CRLF & _ ' /sdp x : Specify Diffprogram to use eg: ' & @CRLF & _ ' /sdp C:\Progra~1\WinMerge\winmerge.exe "%new%" "%old%"' & @CRLF & _ " /nsdp : Don't run program as specified by /sdp." & @CRLF & _ " /kv n : n = number of backcopies to keep. 0 = all" & @CRLF & _ " /bdir x: x = Target backup directory." & @CRLF & _ " /sf : Sort all Func-Endfunc Blocks in sequence FuncName." & @CRLF & _ " When #Region-#EndRegion is used sort them within that scope." & @CRLF & _ " /sfc : Same as /sf but first sorts on Comment at the end of the Func() statement" GUICtrlCreateEdit($temp, 20, 150, 605, 250, $ES_READONLY) GUICtrlSetFont(-1, Default, Default, Default, "Courier New") ;================================================================================================================================= Local $tab5 = GUICtrlCreateTabItem("Obfuscator") ; Run Obfuscator ? GUICtrlCreateLabel("Obfuscator Version: " & FileGetVersion($SciTE_Dir & "\Obfuscator\Obfuscator.exe"), 400, 50, 180, 20, $SS_RIGHT) Local $H_Run_Obfuscator = GUICtrlCreateCheckbox("Run Obfuscator before compilation.", 100, 65, 250, 20) If $INP_Run_Obfuscator = "y" Then GUICtrlSetState($H_Run_Obfuscator, $GUI_CHECKED) GUICtrlCreateLabel("Obfuscator Parameters :", 30, 90, 120, 20, $SS_RIGHT) Local $H_Obuscator_Parameters = GUICtrlCreateInput($INP_Obfuscator_Parameters, 155, 87, 390, 20) $temp = "Possible Parameters: " & @CRLF & _ " /cs 0/1 : 0=No String encryption (1=default)" & @CRLF & _ " /cn 0/1 : 0=No Numeric encryption (1=default)" & @CRLF & _ " /cf 0/1 : 0=No Func rename (1=default)" & @CRLF & _ " /cv 0/1 : 0=No Var rename (1=default)" & @CRLF & _ " /sf 0/1 : 1=Strip all unused Func's (0=default)" & @CRLF & _ " /sv 0/1 : 1=Strip all unused Global var records (0=default)" & @CRLF & _ " /striponly: same as /cs=0 /cn=0 /cf=0 /cv=0 /sf=1 /sv=1" & @CRLF & _ " /striponlyincludes: same as /striponly but will leave master script untouched." & @CRLF & _ " /sci 0 : Default Minimal output to the console: warning and errors." & @CRLF & _ " /sci 1 : Show more progress information. " & @CRLF & _ " /sci 9 : Show all debug lines as found in the Obfuscator.log." & @CRLF & _ " /Beta : Use Beta Includes. Dont use AutoIt3Wrapper_Run_Obfuscator." & @CRLF & _ " " & @CRLF & _ "To strip the source, which is included in the output EXE, from all Comments, Whitespace and All un-used Func's (also included UDF's), you just specify : " & @CRLF & _ "/striponly" GUICtrlCreateEdit($temp, 20, 130, 600, 250, $ES_READONLY) GUICtrlSetFont(-1, Default, Default, Default, "Courier New") ;================================================================================================================================= Local $H_Run_Versioning_n, $H_Run_Versioning_y, $H_Run_Versioning_v Local $H_cvs_Parameters, $tab6 If FileExists($SciTE_Dir & "\VersionWrapper\VersionWrapper.exe") Then $tab6 = GUICtrlCreateTabItem("VersionWrapper") ; Run VersionWrapper GUICtrlCreateLabel("VersionWrapper Version: " & FileGetVersion($SciTE_Dir & "\VersionWrapper\VersionWrapper.exe"), 400, 50, 180, 20, $SS_RIGHT) GUICtrlCreateLabel("Options to run the installed VersionWrapper addon", 30, 70, 600, 20) $H_Run_Versioning_n = GUICtrlCreateRadio("Don't run VersionWrapper.", 100, 95, 260, 20) $H_Run_Versioning_y = GUICtrlCreateRadio("Always Run VersionWrapper.", 100, 115, 260, 20) $H_Run_Versioning_v = GUICtrlCreateRadio("Only when FileVersion_AutoIncrement is set to yes.", 100, 135, 260, 20) Switch $INP_Run_Versioning Case "y" GUICtrlSetState($H_Run_Versioning_y, $GUI_CHECKED) Case "v" GUICtrlSetState($H_Run_Versioning_v, $GUI_CHECKED) Case Else GUICtrlSetState($H_Run_Versioning_n, $GUI_CHECKED) EndSwitch GUICtrlCreateLabel("cvs Parameters :", 10, 165, 90, 20, $SS_RIGHT) $H_cvs_Parameters = GUICtrlCreateInput($INP_Versioning_Parameters, 110, 162, 500, 20) $temp = "Possible parameters. " & @CRLF & _ " /NoPrompt : Will skip the cvsComments prompt" & @CRLF & _ " /Comments : Text to added in the cvsComments. It can contain the below variables." & @CRLF & _ 'The Commandlines can contain the following variables:' & @CRLF & _ ' %in% , %out%, %outx64%, %icon% which will be replaced by the fullpath\filename.' & @CRLF & _ ' %scriptdir% same as @ScriptDir and %scriptfile% = filename without extension.' & @CRLF & _ ' %fileversion% set to the #AutoIt3Wrapper_Res_Fileversion directive value.' & @CRLF & _ ' %scitedir% will be replaced by the SciTE program directory' GUICtrlCreateEdit($temp, 20, 190, 605, 240, $ES_READONLY) GUICtrlSetFont(-1, Default, Default, Default, "Courier New") EndIf ;================================================================================================================================= GUICtrlCreateTabItem("") ; end tabitem definition Local $H_COMPILE = GUICtrlCreateButton("&Compile Script", 120, 445, 120, 30) ; make compile the default button with focus GUICtrlSetState($H_COMPILE, 256) Local $H_SaveOnly = GUICtrlCreateButton("&Save Only", 250, 445, 120, 30) ; Local $H_CANCEL = GUICtrlCreateButton("C&ancel", 380, 445, 120, 30) GUICtrlCreateLabel("(F1 = Help)", 550, 460) GUISetState(@SW_SHOW) ; Process GUI Input ;------------------------------------------------------------------------------------------- While 1 $rc = GUIGetMsg() If $rc = 0 Then ContinueLoop ; Cancel clicked If $rc = $H_CANCEL Then Exit If $rc = $h_Exit Then Exit If $rc = $h_HelpFile Then Run('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') ContinueLoop EndIf If $rc = $h_About Then MsgBox(262208, "AutoIt3Wrapper_GUI", _ "AutoIt3Wrapper GUI is written to add Directives to the scriptsource which are used by AutoIt3Wrapper" & @CRLF & @CRLF & "Copyright (c) Jos van der Zande.") EndIf If $rc = -3 Then Exit ; Change Target program clicked Switch $rc Case $tab Switch GUICtrlRead($tab) Case 1 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') Case 2 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') Case 3 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') Case 4 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/AutoIt3Wrapper.htm"') Case 5 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/tidy_doc.htm"') Case 6 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\Scite4AutoIt3.chm::/Obfuscator_doc.htm"') Case 7 GUISetHelp('"' & @WindowsDir & '\hh.exe" "' & @ScriptDir & '\..\VersionWrapper\VersionWrapper.htm"') EndSwitch Case $H_SCRIPTFILE_OUT_CHANGE $Init_Dir = GUICtrlRead($H_SCRIPTFILE_OUT) $Init_Dir = _PathFull($Init_Dir) $Save_Workdir = @WorkingDir Local $ScriptFile_Out_New = FileOpenDialog("Select the Target program?", $Init_Dir, "Programs(*.Exe;*.A3x)", 2) If @error = 0 And $ScriptFile_Out_New <> "" Then ;$ScriptFile_Out = $ScriptFile_Out_New $ScriptFile_Out_New = DirGetRelativePath($ScriptFile_In, $ScriptFile_Out_New) _PathSplit($ScriptFile_Out_New, $szDrive, $szDir, $szFName, $szExt) If GUICtrlRead($H_Out_Type_a) = $GUI_CHECKED Then If $szExt <> ".a3x" Then $ScriptFile_Out_New = $szDrive & $szDir & $szFName & ".a3x" Else If $szExt <> ".exe" Then $ScriptFile_Out_New = $szDrive & $szDir & $szFName & ".exe" EndIf GUICtrlSetData($H_SCRIPTFILE_OUT, $ScriptFile_Out_New) If StringRight($ScriptFile_Out_New, 3) = "a3x" Then Set_Res_state($GUI_DISABLE) Else Set_Res_state($GUI_ENABLE) EndIf EndIf FileChangeDir($Save_Workdir) Case $H_SCRIPTFILE_OUT_CHANGE_X64 $Init_Dir = GUICtrlRead($H_SCRIPTFILE_OUT_X64) $Init_Dir = _PathFull($Init_Dir) $Save_Workdir = @WorkingDir Local $ScriptFile_Out_New_x64 = FileOpenDialog("Select the Target program?", $Init_Dir, "Programs(*.Exe;*.A3x)", 2) If @error = 0 And $ScriptFile_Out_New_x64 <> "" Then ;$ScriptFile_Out = $ScriptFile_Out_New $ScriptFile_Out_New_x64 = DirGetRelativePath($ScriptFile_In, $ScriptFile_Out_New_x64) _PathSplit($ScriptFile_Out_New_x64, $szDrive, $szDir, $szFName, $szExt) If GUICtrlRead($H_Out_Type_a) = $GUI_CHECKED Then If $szExt <> ".a3x" Then $ScriptFile_Out_New_x64 = $szDrive & $szDir & $szFName & ".a3x" Else If $szExt <> ".exe" Then $ScriptFile_Out_New_x64 = $szDrive & $szDir & $szFName & ".exe" EndIf GUICtrlSetData($H_SCRIPTFILE_OUT_X64, $ScriptFile_Out_New_x64) If StringRight($ScriptFile_Out_New_x64, 3) = "a3x" Then Set_Res_state($GUI_DISABLE) Else Set_Res_state($GUI_ENABLE) EndIf EndIf FileChangeDir($Save_Workdir) ; Change icon clicked Case $H_INP_ICON_CHANGE ;$Init_Dir = RegRead($Registry & "\Aut2Exe", "LastIcon") $Init_Dir = GUICtrlRead($H_INP_ICON) $Init_Dir = _PathFull($Init_Dir) $Save_Workdir = @WorkingDir Local $H_INP_ICON_NEW = FileOpenDialog("Select the ICON for the program?", $Init_Dir, "Icons(*.ico)", 1) If @error = 0 Then If $H_INP_ICON_ICO = 0 Then $H_INP_ICON_ICO = GUICtrlCreateIcon($H_INP_ICON_NEW, Default, 545, 230) GUICtrlSetImage($H_INP_ICON_ICO, $H_INP_ICON_NEW) Else GUICtrlSetImage($H_INP_ICON_ICO, $H_INP_ICON_NEW) EndIf ;~ $INP_Icon = $H_INP_ICON_NEW $H_INP_ICON_NEW = DirGetRelativePath($ScriptFile_In, $H_INP_ICON_NEW) GUICtrlSetData($H_INP_ICON, $H_INP_ICON_NEW) EndIf FileChangeDir($Save_Workdir) Case $H_COMPILE, $H_SaveOnly ; Validate Extra resource Information Local $tempvalues = StringSplit(GUICtrlRead($H_FieldNameEdit), @CRLF) For $U = 1 To $tempvalues[0] If StringStripWS($tempvalues[$U], 3) <> "" And StringInStr($tempvalues[$U], "|") + StringInStr($tempvalues[$U], "=") = 0 Then _GUICtrlTab_SetCurFocus($tab, 1) GUICtrlSetState($H_FieldNameEdit, $GUI_FOCUS) GUICtrlSetTip($H_FieldNameEdit, 'Add extra Resource info. One per line.' & @CRLF & 'Syntax: Fieldname = Description.' & @CRLF & 'Example:Made By = Jos van der Zande') MsgBox(4096 + 16 + 1, "Extra Resource Fields Error.", "There is one or more lines that doesn't contain a =.") ContinueLoop 2 EndIf Next ExitLoop EndSwitch WEnd GUISetState(@SW_HIDE) ; --- Read all info from the GUI Local $Save_Only = 0 Local $Changes = 0 ; If $rc = $H_SaveOnly Then $Save_Only = 1 ; $ScriptFile_Out_New = GUICtrlRead($H_SCRIPTFILE_OUT) _PathSplit($ScriptFile_Out_New, $szDrive, $szDir, $szFName, $szExt) If $ScriptFile_Out_New <> "" Then If GUICtrlRead($H_Out_Type_a) = $GUI_CHECKED Then If $szExt <> ".a3x" Then $ScriptFile_Out_New = $szDrive & $szDir & $szFName & ".a3x" Else If $szExt <> ".exe" Then $ScriptFile_Out_New = $szDrive & $szDir & $szFName & ".exe" EndIf EndIf GUICtrlSetData($H_SCRIPTFILE_OUT, $ScriptFile_Out_New) $Changes += GUI_GetValue($H_SCRIPTFILE_OUT, $ScriptFile_Out) ; $ScriptFile_Out_New_x64 = GUICtrlRead($H_SCRIPTFILE_OUT_X64) _PathSplit($ScriptFile_Out_New_x64, $szDrive, $szDir, $szFName, $szExt) If $ScriptFile_Out_New_x64 <> "" Then If GUICtrlRead($H_Out_Type_a) = $GUI_CHECKED Then If $szExt <> ".a3x" Then $ScriptFile_Out_New_x64 = $szDrive & $szDir & $szFName & ".a3x" Else If $szExt <> ".exe" Then $ScriptFile_Out_New_x64 = $szDrive & $szDir & $szFName & ".exe" EndIf EndIf GUICtrlSetData($H_SCRIPTFILE_OUT_X64, $ScriptFile_Out_New_x64) $Changes += GUI_GetValue($H_SCRIPTFILE_OUT_X64, $ScriptFile_Out_x64) ; Local $GUI_ScriptFile_Out_Type If GUICtrlRead($H_Out_Type_a) = $GUI_CHECKED Then $GUI_ScriptFile_Out_Type = "a3x" Else $GUI_ScriptFile_Out_Type = "exe" EndIf If $ScriptFile_Out_Type <> $GUI_ScriptFile_Out_Type Then $ScriptFile_Out_Type = $GUI_ScriptFile_Out_Type $Changes += 1 EndIf ; $Changes += GUI_GetValue($H_INP_ICON, $INP_Icon) ; $Changes += GUI_GetValue($H_Compression, $INP_W_Compression) If $INP_W_Compression = "Lowest" Then $INP_Compression = "0" If $INP_W_Compression = "Low" Then $INP_Compression = 1 If $INP_W_Compression = "Normal" Then $INP_Compression = 2 If $INP_W_Compression = "High" Then $INP_Compression = 3 If $INP_W_Compression = "Highest" Then $INP_Compression = 4 $Changes += GUI_GetValue($H_Change2CUI, $INP_Change2CUI, "1=y;0=n;4=n") ; ;~ $INP_Allow_Decompile = GUICtrlRead($H_INP_NODECOMPILE) ; $Changes += GUI_GetValue($H_Comment, $INP_Comment) $Changes += GUI_GetValue($H_Description, $INP_Description) $Changes += GUI_GetValue($H_Fileversion, $INP_Fileversion) $Changes += GUI_GetValue($H_Res_Language, $Country) Language_Code($INP_Res_Language, $CountryTable, $Country, 2) ;None, asInvoker, highestAvailable or requireAdministrator (default=None)" Local $GUI_RES_requestedExecutionLevel If GUICtrlRead($H_Res_requestedExecutionLevel_n) = $GUI_CHECKED Then $GUI_RES_requestedExecutionLevel = "None" ElseIf GUICtrlRead($H_Res_requestedExecutionLevel_a) = $GUI_CHECKED Then $GUI_RES_requestedExecutionLevel = "asInvoker" ElseIf GUICtrlRead($H_Res_requestedExecutionLevel_h) = $GUI_CHECKED Then $GUI_RES_requestedExecutionLevel = "highestAvailable" ElseIf GUICtrlRead($H_Res_requestedExecutionLevel_r) = $GUI_CHECKED Then $GUI_RES_requestedExecutionLevel = "requireAdministrator" Else $GUI_RES_requestedExecutionLevel = "" EndIf If $INP_Res_requestedExecutionLevel <> $GUI_RES_requestedExecutionLevel Then $INP_Res_requestedExecutionLevel = $GUI_RES_requestedExecutionLevel $Changes += 1 EndIf ; Local $GUI_Fileversion_AutoIncrement If GUICtrlRead($H_Fileversion_AutoIncrement_y) = $GUI_CHECKED Then $GUI_Fileversion_AutoIncrement = "y" ElseIf GUICtrlRead($H_Fileversion_AutoIncrement_p) = $GUI_CHECKED Then $GUI_Fileversion_AutoIncrement = "p" Else $GUI_Fileversion_AutoIncrement = "n" EndIf If $INP_Fileversion_AutoIncrement <> $GUI_Fileversion_AutoIncrement Then $INP_Fileversion_AutoIncrement = $GUI_Fileversion_AutoIncrement $Changes += 1 EndIf ; $Changes += GUI_GetValue($H_LegalCopyright, $INP_LegalCopyright) $Changes += GUI_GetValue($H_FieldNameEdit, $INP_FieldNameEdit) $Changes += GUI_GetValue($H_Icons, $INP_Icons_txt) $Changes += GUI_GetValue($H_Res_Files, $Inp_Res_Files_txt) $Changes += GUI_GetValue($H_Res_SaveSource, $INP_Res_SaveSource, "1=y;0=n;4=n") ; $Changes += GUI_GetValue($H_Run_AU3Check, $INP_Run_AU3Check, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_Add_Constants, $INP_Add_Constants, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_AU3Check_Stop_OnWarning, $INP_AU3Check_Stop_OnWarning, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_AU3Check_Plugin, $INP_Au3check_Plugin) $Changes += GUI_GetValue($H_AU3Check_Parameters, $INP_AU3Check_Parameters) $Changes += GUI_GetValue($H_Run_Before, $txt_INP_Run_Before) $Changes += GUI_GetValue($H_Run_After, $txt_INP_Run_After) $Changes += GUI_GetValue($H_Run_Tidy, $INP_Run_Tidy, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_Tidy_Stop_OnError, $INP_Tidy_Stop_OnError, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_Tidy_Parameters, $INP_Tidy_Parameters) $Changes += GUI_GetValue($H_Run_Obfuscator, $INP_Run_Obfuscator, "1=y;0=n;4=n") $Changes += GUI_GetValue($H_Obuscator_Parameters, $INP_Obfuscator_Parameters) ; Local $GUI_AutoIt3_Version If GUICtrlRead($H_AUTOIT3_Version_B) = $GUI_CHECKED Then $GUI_AutoIt3_Version = "Beta" Else $GUI_AutoIt3_Version = "Prod" EndIf If $INP_AutoIt3_Version <> $GUI_AutoIt3_Version Then $INP_AutoIt3_Version = $GUI_AutoIt3_Version $Changes += 1 EndIf ; ; X86/X64 logic Local $GUI_UseX64 If GUICtrlRead($H_AUTOIT3_X64) = $GUI_CHECKED And GUICtrlRead($H_AUTOIT3_X86) = $GUI_CHECKED Then If $INP_Compile_Both = 'n' Then $INP_Compile_Both = 'y' $Changes += 1 EndIf Else If $INP_Compile_Both = 'y' Then $INP_Compile_Both = 'n' $Changes += 1 EndIf EndIf ; If GUICtrlRead($H_AUTOIT3_X64) = $GUI_CHECKED Then $GUI_UseX64 = "y" Else $GUI_UseX64 = "n" EndIf If $INP_UseX64 <> $GUI_UseX64 Then $INP_UseX64 = $GUI_UseX64 $Changes += 1 EndIf ; UPX Local $GUI_UseUpx If GUICtrlRead($H_AUTOIT3_Upx) = $GUI_CHECKED Then $GUI_UseUpx = "y" Else $GUI_UseUpx = "n" EndIf If $INP_UseUpx <> $GUI_UseUpx Then $INP_UseUpx = $GUI_UseUpx $Changes += 1 EndIf ; If $H_cvs_Parameters Then ; Check VersionWrapper parameters when VersionWrapper is installed Local $GUI_Run_Versioning If GUICtrlRead($H_Run_Versioning_y) = $GUI_CHECKED Then $GUI_Run_Versioning = "y" ElseIf GUICtrlRead($H_Run_Versioning_v) = $GUI_CHECKED Then $GUI_Run_Versioning = "v" Else $GUI_Run_Versioning = "n" EndIf If $INP_Run_Versioning <> $GUI_Run_Versioning Then $INP_Run_Versioning = $GUI_Run_Versioning $Changes += 1 EndIf $Changes += GUI_GetValue($H_cvs_Parameters, $INP_Versioning_Parameters) EndIf ; GUIDelete() ; Update the source when there where changes. If $Changes > 0 Then ConsoleWrite('-> ' & $Changes & ' Change(s) made.' & @CRLF) Local $Full_source = @CRLF & FileRead($ScriptFile_In) ; Add one @CRLF for REGEX testing purpose to be able to test for whole record. $Full_source = StringRegExpReplace($Full_source, "(?s)(?i)\r\n(\s*)#Region ;\*\*\*\* Directives created by AutoIt3Wrapper_GUI \*\*\*\*(.*?)\r\n", @CRLF) $Full_source = StringRegExpReplace($Full_source, "(?s)(?i)\r\n(\s*)#EndRegion ;\*\*\*\* Directives created by AutoIt3Wrapper_GUI \*\*\*\*(.*?)\r\n", @CRLF) Local $directives = "" If StringRegExp($Full_source, '(?s)(?i)' & @CRLF & '(\s*)#NoTrayIcon(.*?)' & @CRLF) Then $Full_source = StringRegExpReplace($Full_source, '(?s)(?i)' & @CRLF & '#NoTrayIcon(.*?)' & @CRLF, @CRLF) $directives &= "#NoTrayIcon" & @CRLF EndIf ; If StringRegExp($Full_source, '(?s)(?i)' & @CRLF & '(\s*)#RequireAdmin(.*?)' & @CRLF) Then $Full_source = StringRegExpReplace($Full_source, '(?s)(?i)' & @CRLF & '#RequireAdmin(.*?)' & @CRLF, @CRLF) $directives &= "#RequireAdmin" & @CRLF EndIf $directives &= "#Region ;**** Directives created by AutoIt3Wrapper_GUI ****" & @CRLF ; Aut2Exe Directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Prompt", "", "", "") ; Remove this obsolete paremeter Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Version", $INP_AutoIt3_Version, "prod", "p=prod;b=Beta") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Outfile_type", $ScriptFile_Out_Type, "exe", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_aut2exe", "", "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Icon", $INP_Icon, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Outfile", $ScriptFile_Out, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Outfile_x64", $ScriptFile_Out_x64, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Compression", $INP_Compression, "2", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_UseUpx", $INP_UseUpx, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_UPX_Parameters", $INP_Upx_Parameters, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Compile_Both", $INP_Compile_Both, "n", "1=y;0=n") If @OSArch = "X86" Or StringInStr(RegRead("HKCR\AutoIt3Script\Shell\Run\Command", ""), "AutoIt3.exe") Then Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_UseX64", $INP_UseX64, "n", "1=y;0=n;4=n") Else Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_UseX64", $INP_UseX64, "y", "1=y;0=n;4=n") EndIf Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Change2CUI", $INP_Change2CUI, "n", "1=y;0=n;4=n") ; Resource Directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Comment", $INP_Comment, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Description", $INP_Description, "", "") If $INP_Fileversion_AutoIncrement <> "n" And $INP_Fileversion = "" Then $INP_Fileversion = "0.0.0.0" Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Fileversion", $INP_Fileversion, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Fileversion_AutoIncrement", $INP_Fileversion_AutoIncrement, "n", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_ProductVersion", $INP_ProductVersion, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_LegalCopyright", $INP_LegalCopyright, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_SaveSource", $INP_Res_SaveSource, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Language", $INP_Res_Language, "2057", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_requestedExecutionLevel", $INP_Res_requestedExecutionLevel, "default", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Compatibility", $INP_Res_Compatibility, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Field1Name", "", "", "") ; Remove this obsolete paremeter Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Field2Name", "", "", "") ; Remove this obsolete paremeter Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Field1Value", "", "", "") ; Remove this obsolete paremeter Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Field2Value", "", "", "") ; Remove this obsolete paremeter $tempvalues = StringSplit($INP_FieldNameEdit, @CRLF) For $U = 1 To $tempvalues[0] $tempval = StringReplace($tempvalues[$U], "=", "|", 1) $tempval = StringReplace($tempval, " | ", "|", 1) If $tempval <> "|" Then Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Field", $tempval, "", "") Next $tempvalues = StringSplit($INP_Icons_txt, @CRLF) Local $y = 0 ReDim $INP_Icons[$tempvalues[0] + 1] For $x = 1 To $tempvalues[0] $tempval = $tempvalues[$x] If $tempval <> "" Then $y += 1 Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_Icon_Add", $tempval, "", "") $INP_Icons[$y] = $tempval EndIf Next ReDim $INP_Icons[$y + 1] ; $y = 0 $tempvalues = StringSplit($Inp_Res_Files_txt, @CRLF) ReDim $INP_Res_Files[$tempvalues[0] + 1] For $x = 1 To $tempvalues[0] $tempval = $tempvalues[$x] If $tempval <> "" Then $y += 1 Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Res_File_Add", $tempval, "", "") $INP_Res_Files[$y] = $tempval EndIf Next ReDim $INP_Res_Files[$y + 1] ; Au3Check directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_AU3Check", $INP_Run_AU3Check, "y", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Add_Constants", $INP_Add_Constants, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_AU3Check_Stop_OnWarning", $INP_AU3Check_Stop_OnWarning, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_AU3Check_Parameters", $INP_AU3Check_Parameters, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_Before", "", "", "") ; Run Before/After Directives $INP_Run_Before = StringSplit($txt_INP_Run_Before, @CRLF, 1) For $U = 1 To $INP_Run_Before[0] Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_Before", $INP_Run_Before[$U], "", "") Next Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_After", "", "", "") $INP_Run_After = StringSplit($txt_INP_Run_After, @CRLF, 1) For $U = 1 To $INP_Run_After[0] Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_After", $INP_Run_After[$U], "", "") Next ; Tidy Directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_Tidy", $INP_Run_Tidy, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#Tidy_Parameters", $INP_Tidy_Parameters, "", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Tidy_Stop_OnError", $INP_Tidy_Stop_OnError, "y", "1=y;0=n;4=n") ; Obfuscator Directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Run_Obfuscator", $INP_Run_Obfuscator, "n", "1=y;0=n;4=n") Update_Directive($Full_source, $directives, "#Obfuscator_Parameters", $INP_Obfuscator_Parameters, "", "") ; VersionWrapper Directives Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Versioning", $INP_Run_Versioning, "n", "") Update_Directive($Full_source, $directives, "#AutoIt3Wrapper_Versioning_Parameters", $INP_Versioning_Parameters, "", "") ; Local $test = "#Region ;**** Directives created by AutoIt3Wrapper_GUI ****" & @CRLF If StringRight($directives, StringLen($test)) = $test Then $directives = StringTrimRight($directives, StringLen($test)) Else $directives &= "#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****" & @CRLF EndIf ; FileRecycle($ScriptFile_In) Local $Fh = FileOpen($ScriptFile_In, 2 + $SrceUnicodeFlag) FileWrite($Fh, $directives) ; remove the added @CRLF FileWrite($Fh, StringMid($Full_source, 3)) FileClose($Fh) Else ConsoleWrite('-> No changes made..' & @CRLF) EndIf #forceref $H_Res_L01, $H_Res_L02, $H_Res_L03, $H_Res_L04, $H_Res_L05, $H_Res_L06, $H_Res_L07, $H_Res_L08, $H_Res_L09 #forceref $Changes #forceref $tab0, $tab1, $tab1b, $tab2, $tab3, $tab4, $tab5, $tab6, $H_Run_Versioning_n, $H_Run_Versioning_y, $H_Run_Versioning_v If $Save_Only Then Exit ; EndFunc ;==>GUI_Show I attached the entire function. but only the GUI controls are affected (mostly labels, but some GUI width and height). The controls are all hardcoded values, so they probably won't look the same on much larger screen (like 55"). But at least I can read everything on that GUI now. Cheers! Thanks much for your help on this, Jos. I really appreciate it. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 27, 2016 Developers Share Posted February 27, 2016 Thanks, I have merged the changes into the current available Beta. You want to use that one as you have been a little to optimistic with merging old lines back into the current version. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DickG Posted February 27, 2016 Author Share Posted February 27, 2016 28 minutes ago, Jos said: Thanks, I have merged the changes into the current available Beta. You want to use that one as you have been a little to optimistic with merging old lines back into the current version. Jos OK, will do. I certainly didn't mean to do that. I thought I only changed heights and widths. Sorry ... 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