PDA

View Full Version : Restart exe after MDAC



Sheritlw
11-18-2004, 01:41 PM
In On Startup I place the following variables

local sReBootPath = SessionVar.Expand("%SourceFolder%")
local sReBootName = SessionVar.Expand("%SourceFilename%")
msPath = String.Concat("srebootpath", "sReBootName");

What I want to get is the full path the setup.exe that is being ran. For example: c:\Program Files\Downloads\setup.exe.

Then in the installation sections of the dependency modules, just before needsreboot (see below) I thought I would tell the system to rerun the exe after it reboots.

Will this work?

File.RunOnReboot(msPath)
_NeedsReboot = true;

SUF6NEWBIE
11-18-2004, 01:46 PM
could use: SessionVar.Expand("%SourceFilename%");
this should return the 'current' full path to the runtime setup.exe.

may I suggest(if you hav'nt) have a bit of a read of a previous post
regarding Mdac ...rebooting etc etc..

HTH

Adam
11-18-2004, 02:00 PM
Also as far as this code:

local sReBootPath = SessionVar.Expand("%SourceFolder%")
local sReBootName = SessionVar.Expand("%SourceFilename%")
msPath = String.Concat("srebootpath", "sReBootName");

Keep in mind that:

a) Everything is case sensitive in AutoPlay Media Studio 5.0
b) When you reference a variable you should not use quotes.

So your script would be syntactically correct if it looked like this:

local sReBootPath = SessionVar.Expand("%SourceFolder%")
local sReBootName = SessionVar.Expand("%SourceFilename%")
msPath = String.Concat(sReBootPath, sReBootName);

Adam Kapilik

Sheritlw
11-18-2004, 02:10 PM
I change the variable to

msPath = SessionVar.Expand("%SourceFilename%")

Now if I put File.RunOnReboot(msPath) before the _NeedsReboot = True line, in the installation area of an MDAC dependency module, will the setup re-start after the reboot?

local nResult = File.Run(strFileToRun,"/passive","",SW_SHOWNORMAL,true);

-- Delete the runtime installer file and remove the temp folder
File.Delete(strFileToRun);
Folder.Delete(strRuntimeSupportFolder);

-- Tell Setup Factory that a reboot is needed at the end of the install.
File.RunOnReboot(msPath)
_NeedsReboot = true;