Sign in to follow this  
Followers 0
JSThePatriot

Haveing Trouble with Includes

15 posts in this topic

Is AutoIt set to check the registry only? I have downloaded the .zip version, and extracted everything as it is supposed to be done, to no avail.

I have written a few scripts that do not require includes, and they work fine. As soon as I use the #include <GUIConstants.au3> code I error out if I use the AutoIt3.exe. If I am in SciTE no errors, but it just exits out before showing my GUI.

#include <GUIConstants.au3>

$gui_Main = GUICreate("DCMSPassChange", 100, 150)

GUISetState(@SW_SHOW, $gui_Main)

While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
   EndSelect
WEnd

GUIDelete($gui_Main)
Exit

Quite simple code. I didnt think the include would have been stopping it until I ran the script outside of SciTE, and it said:

Error reading the file:

GUIConstants.au3

If anyone has any solution please let me know.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites



Is AutoIt set to check the registry only? I have downloaded the .zip version, and extracted everything as it is supposed to be done, to no avail.

I have written a few scripts that do not require includes, and they work fine. As soon as I use the #include <GUIConstants.au3> code I error out if I use the AutoIt3.exe. If I am in SciTE no errors, but it just exits out before showing my GUI.

#include <GUIConstants.au3>

$gui_Main = GUICreate("DCMSPassChange", 100, 150)

GUISetState(@SW_SHOW, $gui_Main)

While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
   EndSelect
WEnd

GUIDelete($gui_Main)
Exit

Quite simple code. I didnt think the include would have been stopping it until I ran the script outside of SciTE, and it said:

If anyone has any solution please let me know.

JS

Can you just

#include <C:\Full\Path\To\Included\File\GUIConstants.au3>

[quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD()

Share this post


Link to post
Share on other sites

Can you just

#include <C:\Full\Path\To\Included\File\GUIConstants.au3>
I assume that putting in a static address to it wouldnt hurt. The only problem with that is if I leave it as a script, and move from computer to computer it will possibly be different based on CD-ROM's and HDD's.

Any other solution you can think of?

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

JS, Valik has written several times on the problem of where AutoIt does/should look for includes when installed via .ZIP. I'd search for his posts if I were in your circumstances.

Gene

Is AutoIt set to check the registry only? I have downloaded the .zip version, and extracted everything as it is supposed to be done, to no avail.

I have written a few scripts that do not require includes, and they work fine. As soon as I use the #include <GUIConstants.au3> code I error out if I use the AutoIt3.exe. If I am in SciTE no errors, but it just exits out before showing my GUI.

#include <GUIConstants.au3>

$gui_Main = GUICreate("DCMSPassChange", 100, 150)

GUISetState(@SW_SHOW, $gui_Main)

While 1
   $msg = GUIGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
   EndSelect
WEnd

GUIDelete($gui_Main)
Exit

Quite simple code. I didnt think the include would have been stopping it until I ran the script outside of SciTE, and it said:

If anyone has any solution please let me know.

JS


[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

JS, Here is a WAG aka Wild A__ed Guess.

As long as you are not going to compile them, shouldn't a construct like this work? Since, as I look at it, its using literal strings, it might even compile.

I realize it has a certain kludge factor to it, but if it works, that might be more important. On the other hand, I'm a little annoyed with anyone who flaunts a 4GB flash drive. :lmao:

Gene

$InclDriveD = "D"
$InclDriveE = "E"
$InclDriveF = "F"
$InclDriveG = "G"
$InclDriveH = "H"
$InclDriveI = "I"
$InclDriveJ = "J"
$InclDriveK = "K"

If StringLeft(@ScriptDir,1) = $InclDriveD Then 
#include "D:\AutoIt3\Include\GUIConstants.au3"
#include "D:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveE Then 
#include "E:\AutoIt3\Include\GUIConstants.au3"
#include "E:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveF Then 
#include "F:\AutoIt3\Include\GUIConstants.au3"
#include "F:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveG Then 
#include "G:\AutoIt3\Include\GUIConstants.au3"
#include "G:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveH Then 
#include "H:\AutoIt3\Include\GUIConstants.au3"
#include "H:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveI Then 
#include "I:\AutoIt3\Include\GUIConstants.au3"
#include "I:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveJ Then 
#include "J:\AutoIt3\Include\GUIConstants.au3"
#include "J:\AutoIt3\Include\Arrays.au3.au3"
EndIf 
If StringLeft(@ScriptDir,1) = $InclDriveK Then 
#include "K:\AutoIt3\Include\GUIConstants.au3"
#include "K:\AutoIt3\Include\Arrays.au3.au3"
EndIf

I assume that putting in a static address to it wouldnt hurt. The only problem with that is if I leave it as a script, and move from computer to computer it will possibly be different based on CD-ROM's and HDD's.

Any other solution you can think of?

JS

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

That seems to be a good solution. Thanks for the work around. I would have thought something a bit better would be possible. Who knows... ;)

About the 4GB flash drive. (It actually is 'installed' as a hdd). I went to purchase a 1GB flash drive... it was $105 + tax. I looked over and saw the 4GB for like $120 + tax. I said waiit a minute! Give me the 4GB. :lmao:

Thats my story on that.

JS

P.S. I hope a better solution comes up...


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Just update this registry entry with the path to AutoIt3 on the USB drive and things should work:

RegWrite("HKLM\Software\AutoIt v3\Autoit", 'InstallDir', 'REG_SZ', "USD DRIVE PATH")

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Just update this registry entry with the path to AutoIt3 on the USB drive and things should work:

RegWrite("HKLM\Software\AutoIt v3\Autoit", 'InstallDir', 'REG_SZ', "USD DRIVE PATH")

I am using this flash drive on computers that do not have AutoIt installed. I am wanting transportability. I thought that there have been people in the past that have completed this, but I have as of yet been unable to dig up anything. :lmao:

Thanks for the input though...

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

I am using this flash drive on computers that do not have AutoIt installed. I am wanting transportability. I thought that there have been people in the past that have completed this, but I have as of yet been unable to dig up anything. :lmao:

Thanks for the input though...

JS

I remembered we discussed this before and found the thread again .... it has a script that does all the settings to be able to run from a flashdrive : http://www.autoitscript.com/forum/index.ph...indpost&p=64536

Might need some updating ...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Gene is right, I've mentioned this before. The current logic used to detect the AutoIt standard installation directory is pretty retarded when running without AutoIt installed. I intend to fix this and hope to start preliminary work on it today. Until I complete those changes, you will need to use a solution like what JdeB has linked to or use a relative path in your #include.

Share this post


Link to post
Share on other sites

my 1gig flash drive died today! wwaaahh!!!! thank god for daily backups!!!

Share this post


Link to post
Share on other sites

Gene is right, I've mentioned this before. The current logic used to detect the AutoIt standard installation directory is pretty retarded when running without AutoIt installed. I intend to fix this and hope to start preliminary work on it today. Until I complete those changes, you will need to use a solution like what JdeB has linked to or use a relative path in your #include.

@Valik

Thanks for the efforts. I will use the relative path for the includes. (I hadnt even tried that as I had 2 different problems... that should work great.

@JdeB

Thanks for the script it looks quite good. My only problem is the users laptops I would be using this on I dont believe allows for Registry editing. They may, but I know that some of the desktops do not allow it. So maybe I can use it sometimes and not others.

Thanks everyone!

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

I run into this same problem today. Copied my AutoIt3 directory on my flash drive and tried to use it on a portable PC and had problem with include.

It will be so cool if we can carry our scripts in our pocket and use it on any systems we need to work on. That will be great!

Please keep us posted on any new development. Thanks.

Share this post


Link to post
Share on other sites

I run into this same problem today. Copied my AutoIt3 directory on my flash drive and tried to use it on a portable PC and had problem with include.

It will be so cool if we can carry our scripts in our pocket and use it on any systems we need to work on. That will be great!

Please keep us posted on any new development. Thanks.

Well, if you were truly interested, you would be watching the "Latest Beta" thread to see if #include is mentioned rather than relying on me to specifically see you out and impart an update status on you.

Share this post


Link to post
Share on other sites

Guess I never ventured to the Developers Form :o

Now I will. Thanks.

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  
Followers 0