parallon
03-03-2005, 05:57 PM
I just installed the update to 7.0.2.0 which fixed that problem with the %DAOPath% and the %CommonFiles% thing. Now I am having a problem with a script that is supposed to copy manuals to a predefined place assuming all criteria are met.
Here is how it works... If the user is installing from a CD, then After Install, the script sees that DriveType == 5 and then will prompt the user to install the manuals if they want to and present them with a default path. If they choose to, then when they click on Next, it should copy the manuals to the %ManualDir% and then show a dialog box stating that the manuals were copied to %ManualDir%. If the user clears the path, then the install will just go to the 'Install Complete' screen. Well, now, I get the option to copy the manuals, but when I click Next, it just goes to the Install Complete screen and never copies the manuals.
Here is the code for the After Install screen:
ON PRELOAD:
if SessionVar.Expand"%DriveType%" == "5" then -- If DriveType is a CD/DVD Rom then prepare to copy manuals.
-- calculate the amount of space required for the installation
_SpaceRequired = SetupData.CalculateRequiredSpace();
-- format it as a string with an appropriate unit of measurement (e.g. "0 bytes")
local strSpaceRequired = String.GetFormattedSize(_SpaceRequired);
-- store the string in a session variable so it can be used in the screen text
SessionVar.Set("%SpaceRequired%", strSpaceRequired);
-- from _SUF70_Global_Functions.lua:
-- update the 'Space required:' message (expands any session variables in it)
g_UpdateStaticTextCtrl(CTRL_STATICTEXT_SPACEREQUIR ED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
else
Screen.Jump("Finished Install");
end
ON NEXT:
--// If the user chooses to copy User Manuals (from CD only) to the hard drive,
--// the following will copy the manuals to the location stored in the %ManualDir% variable.
if SessionVar.Expand"%ManualDir%" ~= "" and SessionVar.Expand"%DriveType%" == "5" then -- If %ManualDir% is not empty, then...
File.Copy(SessionVar.Expand"%SourceFolder%\\Docs\\Manuals\\*.pdf", SessionVar.Expand"%ManualDir%", true, true, false, true, nil);
Dialog.Message ("Manuals Copied", "Manuals have been copied to: " .."'" ..SessionVar.Expand("%ManualDir%") .."'" , MB_OK, MB_ICONINFORMATION);
else
end
Any ideas???
Thanks in advance,
Parallon
Here is how it works... If the user is installing from a CD, then After Install, the script sees that DriveType == 5 and then will prompt the user to install the manuals if they want to and present them with a default path. If they choose to, then when they click on Next, it should copy the manuals to the %ManualDir% and then show a dialog box stating that the manuals were copied to %ManualDir%. If the user clears the path, then the install will just go to the 'Install Complete' screen. Well, now, I get the option to copy the manuals, but when I click Next, it just goes to the Install Complete screen and never copies the manuals.
Here is the code for the After Install screen:
ON PRELOAD:
if SessionVar.Expand"%DriveType%" == "5" then -- If DriveType is a CD/DVD Rom then prepare to copy manuals.
-- calculate the amount of space required for the installation
_SpaceRequired = SetupData.CalculateRequiredSpace();
-- format it as a string with an appropriate unit of measurement (e.g. "0 bytes")
local strSpaceRequired = String.GetFormattedSize(_SpaceRequired);
-- store the string in a session variable so it can be used in the screen text
SessionVar.Set("%SpaceRequired%", strSpaceRequired);
-- from _SUF70_Global_Functions.lua:
-- update the 'Space required:' message (expands any session variables in it)
g_UpdateStaticTextCtrl(CTRL_STATICTEXT_SPACEREQUIR ED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
else
Screen.Jump("Finished Install");
end
ON NEXT:
--// If the user chooses to copy User Manuals (from CD only) to the hard drive,
--// the following will copy the manuals to the location stored in the %ManualDir% variable.
if SessionVar.Expand"%ManualDir%" ~= "" and SessionVar.Expand"%DriveType%" == "5" then -- If %ManualDir% is not empty, then...
File.Copy(SessionVar.Expand"%SourceFolder%\\Docs\\Manuals\\*.pdf", SessionVar.Expand"%ManualDir%", true, true, false, true, nil);
Dialog.Message ("Manuals Copied", "Manuals have been copied to: " .."'" ..SessionVar.Expand("%ManualDir%") .."'" , MB_OK, MB_ICONINFORMATION);
else
end
Any ideas???
Thanks in advance,
Parallon