Jump to content
Sign in to follow this  

Test My Compiled Script

Recommended Posts

So i have made this Script that writes the location of the files to a ini file. My problem is that on one of my PC the edit field isnt showing any text "hidden for some reason". I can tell its hidden bec. what ever is written to the edit field gets written in the ini file. I have compiled the script using x86 as it was a 32bit OS. My other 2 PC are running it just fine One 64bit and the other is a Virtual Box 32bit.

So i want u guys to test it and tell me if u encountered the same problem as me or maybe this PC is busted lol.

Attached file is compiled at 32bit but i think 64bit users have no issues running it.

If u want to see the code Here it is.

#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include <Misc.au3>
#include <WinAPIFiles.au3>

Global $g_iButtonCount = 0
Global $FieldCount = 1
Global $Dir = @ScriptDir&"\"&"Settings.ini"
;~ First Browse Button Top Location
Global $g_iTop = 112

Global $g_aBrowse[0][2], $g_sBrowseFolder, $g_sSelectFolder, $g_sBrowseFields

Global $g_hMainForm = GUICreate("Auto Backup", 453, 180, 900, 247)

Global $g_sBackupLocation = GUICtrlCreateLabel("Location of the Backup Folder:", 8, 8, 169, 19)
    GUICtrlSetFont($g_sBackupLocation, 10, 400, 0, "Calibri")
Global $g_idBrowseButton = GUICtrlCreateButton("Browse", 8, 32, 65, 17)
Global $g_idBrowseField = GUICtrlCreateEdit("", 80, 32, 329, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))

   Local $BackupFolderRead = IniRead ($Dir, "Direct", "BackUpDirectory", "" )

Global $g_idFolderBackup = GUICtrlCreateLabel("Locations of the Folder to be Backup:", 8, 80, 205, 19)
    GUICtrlSetFont($g_idFolderBackup, 10, 400, 0, "Calibri")
Global $g_idBackupButton = GUICtrlCreateButton("OK", 200, 144, 73, 25)
Global $g_idExpandButton = GUICtrlCreateButton("+", 416, 112, 17, 17)

;~ Add the first Browse/Field Controls


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $g_idExpandButton
            If $g_iButtonCount <= 3 Then
               $g_iButtonCount += 1
               MsgBox($MB_SYSTEMMODAL, "Notice", "Maximum Number of Locations Reached")

        Case $g_idBrowseButton
           Local $BackupFolder = DirectoryBrowse()

        Case $g_idBackupButton
            IniWrite($Dir,"Direct","IterationNumber",$FieldCount - 1)

        Case Else

            If $nMsg == 9 Then
               $g_sSelectFolder = DirectoryBrowse()
               GUICtrlSetData($g_aBrowse[0][1], $g_sSelectFolder)

            ElseIf $nMsg == 11 Then
               $g_sSelectFolder = DirectoryBrowse()
               GUICtrlSetData($g_aBrowse[1][1], $g_sSelectFolder)

            ElseIf $nMsg == 13 Then
               $g_sSelectFolder = DirectoryBrowse()
               GUICtrlSetData($g_aBrowse[2][1], $g_sSelectFolder)

            ElseIf $nMsg == 15 Then
               $g_sSelectFolder = DirectoryBrowse()
               GUICtrlSetData($g_aBrowse[3][1], $g_sSelectFolder)

            ElseIf $nMsg == 17 Then
               $g_sSelectFolder = DirectoryBrowse()
               GUICtrlSetData($g_aBrowse[4][1], $g_sSelectFolder)



Func ExpandGUI()
   Local $GuiPosition = WinGetPos($g_hMainForm) ; Get the GUI coördinates
   WinMove($g_hMainForm, "", $GuiPosition[0], $GuiPosition[1], $GuiPosition[2], $GuiPosition[3] + 30)

Func AddField()
    Local $iArrayAdd = _ArrayAdd($g_aBrowse, GUICtrlCreateButton("Browse", 8, $g_iTop, 65, 17) & "|" & GUICtrlCreateEdit("", 80, $g_iTop, 329, 17, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)))
    $g_iTop += 28

    Local $BackupLocationRead = IniRead ($Dir, "Direct", "Location" &$FieldCount, "" )
    $FieldCount = $FieldCount + 1


Func DirectoryBrowse()
   Local $num = 1
    ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
    Local Const $sMessage = "Select a folder"

    ; Display an open dialog to select a file.
    Local $sFileSelectFolder = FileSelectFolder($sMessage, "")
    If @error Then
        ; Display the error message.
  ;      MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
        ; Display the selected folder.
   ;     MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
     Return $sFileSelectFolder


Func DataToIni()

   Local $Location,$BackupDirectory,$Counter

   For $Counter = 1 To $FieldCount-1 Step + 1
      $Location = GUICtrlRead($g_aBrowse[$Counter -1][1])
      IniWrite($Dir,"Direct","Location" &$Counter,$Location)

   $BackupFolder = GUICtrlRead($g_idBrowseField)




Edited by JLogan3o13

Share this post

Link to post
Share on other sites

@BlackSnoww as an awareness I have removed the exe you attached to your post. Not that there was anything wrong with the exe, but always better to post your code as you have done and let folks download and compile for themselves. Otherwise (as in this case) it brings the Wannabe Mods out of the woodwork reporting your thread :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...