Sign in to follow this  
Followers 0
lilx

Question About Vista

12 posts in this topic

hello, i created a few handy macro's for a game and i want to make it vista capable so my question is

can i use the follewing commands:

make ini

pixelgetcolor

mouseclick

send

tooltip

WinExists

winwaitactive

run

ShellExecute

regwrite

please let me know.

Share this post


Link to post
Share on other sites

if no one knows the answer or don't want to answer is there a topic where i can find if all the autoit functions work on windows vista?

Share this post


Link to post
Share on other sites

if no one knows the answer or don't want to answer is there a topic where i can find if all the autoit functions work on windows vista?

You might want to just try it. Most should work. If you have any trouble with commands, post a more specific example of such problems so it can be figured out.

One hint though: under Vista, it is always a good idea to put a #RequireAdmin directive on the top of your script, triggering process elevation, which is necessary if you want to do things like accessing Windows/Program Files/etc. folders, or manipulate registry.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

hello,

i understand just to try it but the problem is i use windows xp.. but some ppl use my scripts to and the are under windows vista so it is hard to code and fix problem for a other platform if you just won't know what the problem is.. and i tried to ask what the problem, but they can't explain me in a way that i understand that's why i aksed here if some functions that i use on my macro won't work on vista..

but thank you for the reply :)

Share this post


Link to post
Share on other sites

hello,

i understand just to try it but the problem is i use windows xp.. but some ppl use my scripts to and the are under windows vista so it is hard to code and fix problem for a other platform if you just won't know what the problem is.. and i tried to ask what the problem, but they can't explain me in a way that i understand that's why i aksed here if some functions that i use on my macro won't work on vista..

but thank you for the reply :)

Well, commands that you listed and that I had trouble with when starting to script for Vista are run, ShellExecute and regwrite. These problems were gone after I 1. introduced #RequireAdmin, and 2. stopped using Run. I am not sure why Run gave me trouble, I just found out ShellExecute works better in Vista.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Two of my scripts that ran on Win XP without any errors spew out errors on Vista.... I haven't bothered finding out if it was a bug in my code or in AutoIt but it worked again when i added

Opt("MustDeclareVars", 0)
so i would recommend using that if it is a viable option

Share this post


Link to post
Share on other sites

thank you for the help :) and will try to use the options you guys gave me.. and if someone knows if there are any conflict with the other functions please let me know ;)

Share this post


Link to post
Share on other sites

Two of my scripts that ran on Win XP without any errors spew out errors on Vista.... I haven't bothered finding out if it was a bug in my code or in AutoIt but it worked again when i added

Opt("MustDeclareVars", 0)
so i would recommend using that if it is a viable option
The exact same problem happened to my script: the functions did not fail, no error was produced, just the instructions were not carried out (regwriting, fileinstalling and running and such). This is due to the heavier protection layers in Vista, like UAC. You need your script to elevate itself to run with admin privileges (needed for reg manipulation and such), which is done by #RequireAdmin. In XP, elevation is very easy and mostly happens automatically when run by admin-privileged users, so you don't notice it at all. Vista requires the user to acknowledge the admin privileges for processes that do those dangerous things. That also makes MANY xp viruses not run at all under Vista because process elevation was ignored by many virus writers.

A MustDeclareVars of 1 still spits out errors when vars are not declared, even under Vista. Or at least it should - I will now fire up Vista on my laptop and try it for you.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

ok i hope you can come with some nice answers ;) for me and other ppl :)

Share this post


Link to post
Share on other sites

The exact same problem happened to my script: the functions did not fail, no error was produced, just the instructions were not carried out (regwriting, fileinstalling and running and such). This is due to the heavier protection layers in Vista, like UAC. You need your script to elevate itself to run with admin privileges (needed for reg manipulation and such), which is done by #RequireAdmin. In XP, elevation is very easy and mostly happens automatically when run by admin-privileged users, so you don't notice it at all. Vista requires the user to acknowledge the admin privileges for processes that do those dangerous things. That also makes MANY xp viruses not run at all under Vista because process elevation was ignored by many virus writers.

A MustDeclareVars of 1 still spits out errors when vars are not declared, even under Vista. Or at least it should - I will now fire up Vista on my laptop and try it for you.

As i stated in my previous post i never bothered to find why those two scripts spew errors on vista and refused to run, but if you find anything interesting in your tries it will be fun to see your results :)

Share this post


Link to post
Share on other sites

ok i hope you can come with some nice answers ;) for me and other ppl :)

Sure:

Example 1:

Opt("MustDeclareVars",1)

$var = "testkey"

RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\Run","testvalue","REG_SZ",$var)

This returns both on XP and Vista the same error:

D:\_AutoIt\_Projects\test46.au3(3,17) : WARNING: $var possibly not declared/created yet

So that is confirmed ;)

Example 2:

$var = "testkey"

RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\Run","testvalue","REG_SZ",$var)

This works like a charm in WinXP, no problem whatsoever, the value is created (from administrative user account).

In Vista however, it sets @error to 1 ("1 if unable to open requested key"), but does not produce any error in the console or with a popup. Just doesn't work :P (But it is supposed to do that when it fails.)

Example 3:

#RequireAdmin

$var = "testkey"

RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\Run","testvalue","REG_SZ",$var)

This ALSO works like a charm in XP. Nothing is different from the 2nd example as far as XP is concerned.

In Vista however you get a popup asking for permission to allow the program to run with admin privileges. When you don't permit it, the funtion fails, but when you do permit it, the function also works like a charm in Vista.

NOTE: If you "try this at home", be sure to remove the created test value from the registry manually, otherwise at next reboot you would get a Windows error :P


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

so requireadmin will work on most/all the functions ok thx for the testing

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