Drew Posted April 29, 2008 Share Posted April 29, 2008 I can't figure this problem out either. Or maybe it's not a problem , and it's just that I'm not doing it right... But here we go:When: Case $FullInstall , I need it to do the FileInstalls.Oh wow. Something just hit me... FileInstall takes action at these two times: When source is compiled , and when the Program is run.So I can't have this happen when I press a button... Well that sparks a new question...How can I make it so that when user presses the button $FullInstall , It extracts these files to the specified location? ( In my test-ready script , @DesktopDir& "\testcomplete\File.Extension")Here's my script.NOTE: Yes you will see that this program is made for Diablo II. No need to hide it, this is NOT a hack, this is NOT a bot... This program in NO way gives any user any advantage over any other user. This program will help confused players install and configure their files to play on a private server that I am part of the staff. I clearify that this is NOT a hack of any kind because I have had people turn away from helping me because they thought I was creating a hack.expandcollapse popup;Notes ; ;Remember to add "GUICtrlSetbkColor(-1, 0x000000)" to the new buttons to make them show up black!!!! ; ;Things to Do: ; ;Alot. ; ; ; #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $InstallFile = True #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 476, 513, 204, 122) GUISetBkColor(0x000000) $Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Dreu\Desktop\GUI_Images\Skull.JPG", 8, 0, 481, 401, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $Label1 = GUICtrlCreateLabel("D2War Installer V1.0.0", 16, 480, 166, 25) GUICtrlSetFont(-1, 12, 800, 2, "Palatino Linotype") GUICtrlSetColor(-1, 0x808000) $Label2 = GUICtrlCreateLabel("By: Dreu ( Aka Veteran )", 288, 480, 177, 25) GUICtrlSetFont(-1, 12, 800, 2, "Palatino Linotype") GUICtrlSetColor(-1, 0x808000) $ReadMe = GUICtrlCreateButton("Read Me", 192, 440, 113, 25, 0, $WS_EX_STATICEDGE) GUICtrlSetFont(-1, 10, 800, 2, "Palatino Linotype") GUICtrlSetColor(-1, 0x808000) GUICtrlSetbkColor(-1, 0x000000) $FullInstall = GUICtrlCreateButton("Full Install", 160, 392, 177, 33, 0, $WS_EX_STATICEDGE) GUICtrlSetFont(-1, 12, 800, 2, "Palatino Linotype") GUICtrlSetColor(-1, 0x808000) GUICtrlSetbkColor(-1, 0x000000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ReadMe MsgBox( 0, "Yep", "Works") Case $FullInstall $D2WarFolder = Inputbox( "D2War Folder Name", "Please enter the name of the Diablo II folder you wish to use for D2War.") MsgBox( 0, "Folder", "The Folder You Chose Was: "&$D2WarFolder) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Glide.dll", @desktopdir& "" &$D2WarFolder &"\D2Glide.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Gdi.dll", @desktopdir& "" &$D2WarFolder &"\D2Gdi.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2gfx.dll", @desktopdir& "" &$D2WarFolder &"\D2gfx.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Direct3D.dll", @desktopdir& "" &$D2WarFolder&"\D2Direct3D.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Game.dll", @desktopdir& "" &$D2WarFolder&"\D2Game.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Common.dll", @desktopdir& "" &$D2WarFolder&"\D2Common.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Launch.dll", @desktopdir& "" &$D2WarFolder&"\D2Launch.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2MCPClient.dll", @desktopdir& "" &$D2WarFolder&"\D2MCPClient.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Multi.dll", @desktopdir& "" &$D2WarFolder&"\D2Multi.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Net.dll", @desktopdir& "" &$D2WarFolder&"\D2Net.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2sound.dll", @desktopdir& "" &$D2WarFolder&"\D2sound.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Lang.dll", @desktopdir& "" &$D2WarFolder&"\D2Lang.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Win.dll", @desktopdir& "" &$D2WarFolder&"\D2Win.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\Storm.dll", @desktopdir& "" &$D2WarFolder&"\Storm.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\Fog.dll", @desktopdir& "" &$D2WarFolder&"\Fog.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\ijl11.dll", @desktopdir& "" &$D2WarFolder&"\ijl11.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2CMP.dll", @desktopdir& "" &$D2WarFolder&"\D2CMP.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2DDraw.dll", @desktopdir& "" &$D2WarFolder&"\D2DDraw.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\D2Client.dll", @desktopdir& "" &$D2WarFolder&"\D2Client.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\Bnclient.dll", @desktopdir& "" &$D2WarFolder&"\Bnclient.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\binkw32.dll", @desktopdir& "" &$D2WarFolder&"\binkw32.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\Patch_D2.mpq", @desktopdir& "" &$D2WarFolder&"\Patch_D2.mpq", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\SmackW32.dll", @desktopdir& "" &$D2WarFolder&"\SmackW32.dll", 1) If $InstallFile = True Then FileInstall("C:\Documents and Settings\Dreu\Desktop\d2war_files_v1.1\Diablo II.exe", @desktopdir& "" &$D2WarFolder&"\Diablo II.exe", 1) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Generator Posted April 29, 2008 Share Posted April 29, 2008 Nothing looks wrong at the first glance of your script, since I don't have AutoIt installed here unfortunately i can't help you on this one. But why declaring a boolean true at the beginning and making an if statement in the middle, extra work for nothing. Link to comment Share on other sites More sharing options...
Drew Posted April 29, 2008 Author Share Posted April 29, 2008 This is the direct example from the command: FileInstall Located in the help file: $b = True If $b = True Then FileInstall("C:\test.bmp", "D:\mydir\test.bmp") So thats the format I followed. I learn as I go, and I start at the helpfile. =) Link to comment Share on other sites More sharing options...
covaks Posted April 29, 2008 Share Posted April 29, 2008 I still think you should just zip everything up, including an unzip.exe, and then you just need two FileInstall commands. Then, you could have a button that fires up the unzip.exe and extracts everything when the user wants. Would probably make things easier. Plus, if you ever need to redo the files, you don't have to modify/re-compile your script, just update the files.zip and your set. Link to comment Share on other sites More sharing options...
Generator Posted April 29, 2008 Share Posted April 29, 2008 This is the direct example from the command: FileInstallLocated in the help file:$b = TrueIf $b = True Then FileInstall("C:\test.bmp", "D:\mydir\test.bmp")So thats the format I followed. I learn as I go, and I start at the helpfile. =)Good to hear that. But as you move along you'll realized that the button is the if statement you'll be triggering(In this case, case statement) and there' no need to put If in front of every file install. Even though you want to you can put them all under 1 if statement. To improve you program(If you intend to publish it at some point) you can add some simple error checking which prevents user from screwing around and messing up the script. 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