PDA

View Full Version : Newbie Please help


graham
03-16-2006, 04:36 AM
I am trying to link a variable from a ComboBox to a Button

my vain attempts so far :rolleyes

result = ComboBox.GetSelected("ComboBox1");

if result == 1 then File.Run("setup\\xp\\professional\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);
elseif result == 2 then File.Run("setup\\xp\\home\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);
--if result == 4 then File.Run("", "", "", SW_MAXIMIZE, false);
--if result == 5 then File.Run("", "", "", SW_MAXIMIZE, false);
elseif result == 5 then File.Run("setup\\98se\\setup.exe", "", "", SW_MAXIMIZE, false);
end

yosik
03-16-2006, 09:12 AM
The only thing I can see so far as a problem in your code is the call to the exe. You start with the setup folder, where is it located? Your best bet would be to move it to the Docs folder and call it from there.
Hope that helps.

Yossi

jfxwave
03-16-2006, 09:23 AM
I'm just starting out myself but i did notice something but it just might be a typo. Looks like there is a space.


if result == 1 then File.Run("setup\\xp\\professional\\i386\\winnt32.e xe", "", "", SW_MAXIMIZE, false);
elseif result == 2 then File.Run("setup\\xp\\home\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);
--if result == 4 then File.Run("", "", "", SW_MAXIMIZE, false);
--if result == 5 then File.Run("", "", "", SW_MAXIMIZE, false);
elseif result == 5 then File.Run("setup\\98se\\setup.exe", "", "", SW_MAXIMIZE, false);
end

TJS
03-16-2006, 10:12 AM
The only thing I can see so far as a problem in your code is the call to the exe. You start with the setup folder, where is it located? Your best bet would be to move it to the Docs folder and call it from there.
Hope that helps.

Further to Yossi's point, you'll need to state in your script where the .exe specifically is. There are several ways to do this:

1. Hard code the path
File.Run("C:\\WINNT\\System32\\setup\\xp\\professional\\i386 \\winnt32.exe", "", "", SW_MAXIMIZE, false);

2. Use a global (built-in) variable to establish a path relative to where your AMS app is running from
File.Run(_SystemFolder.."\\setup\\xp\\professional\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);

3. Lookup the location of the .exe if you know that it has been stored elsewhere (i.e. registry or .INI file)


P.S. Nice avatar!

graham
03-16-2006, 11:10 AM
thx for this guys .... still not working though

here's what I am wanting to do .... all the OS's on 1 DVD ... I need to be able to install from this DVD

any further help is appreciated :yes

Roboblue
03-16-2006, 11:43 AM
thx for this guys .... still not working though

here's what I am wanting to do .... all the OS's on 1 DVD ... I need to be able to install from this DVD

any further help is appreciated :yes
So, the setup exe's will be on the same CD as the AMS exe?
Hard to preview to see if it works, as you would have to build to the ROOT of a drive, then have the rest of the folders/files put at ROOT also.
You would almost have to burn it it to test.
However, try this:
Build the project to a folder.
In your CD burner program, put the built project so that the autorun.exe is at ROOT. Put your setup folders files in the order as you have shown here.
then, for the path you have set in your project use:

File.Run(_SourceDrive.. "\\setup\\xp\\home\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);

this will give the autorun.exe the path from ROOT of the CD.

TJS
03-16-2006, 11:49 AM
Ok... I need a little clarification... Are you trying to call the .exe file that is on the user's system or on the DVD?

If they are on the DVD, this should work assuming that the "setup" folder is off the root of the DVD. Otherwise adjust the path accordingly.


if result == 1 then File.Run(_SourceDrive.."\\setup\\xp\\professional\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);
elseif result == 2 then File.Run(_SourceDrive.."\\setup\\xp\\home\\i386\\winnt32.exe", "", "", SW_MAXIMIZE, false);
--if result == 4 then File.Run("", "", "", SW_MAXIMIZE, false);
--if result == 5 then File.Run("", "", "", SW_MAXIMIZE, false);
elseif result == 5 then File.Run(_SourceDrive.."\\setup\\98se\\setup.exe", "", "", SW_MAXIMIZE, false);
end


If you are trying to call the .exe from the user's system, please repost the code that is not working. We may have to add some script to find or confrim the file's existance and location before running it.

graham
03-16-2006, 01:20 PM
Thx Guys
all working now .... just needed writing to DVD ... wich set the path correctly

:lol

yosik
03-16-2006, 05:13 PM
Good for you.
Yossi