Indigo Rose Software
Indigo Rose Software
Log in to the Customer Portal Customer Login
Software Development Discussion Forums Forums
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    18

    file.copy error after 7.0.2.0 update

    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:

    Code:
    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_SPACEREQUIRED, "IDS_CTRL_STATICTEXT_SPACEREQUIRED");
    
    else
    Screen.Jump("Finished Install");
    end

    ON NEXT:

    Code:
    --// 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
    Last edited by parallon; 03-03-2005 at 04:58 PM. Reason: change title

  2. #2
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    My first thought: You are missing the parenthesis. The correct syntax is:
    if SessionVar.Expand("%DriveType%") == "5" then

    But I experienced that SUF70 accepts SessionVar.Expand"%DriveType%"; and the code is working as expected on my side.

    Are you sure, has %DriveType% the correct value? Add a statement to test the value (debug/log/message); for instance:
    Dialog.Message("", "The drive type is "..SessionVar.Expand("%DriveType%"));

  3. #3
    Join Date
    Jan 2005
    Posts
    18

    Got it...

    I finally figured it out. I noticed in the release notes for the update for 7.0.2.0 that they changed the actions for Screen.End, Screen.Next, etc. so that the script from which the action is called stops executing after that action is performed, instead of running through it like 7.0.1.0. Well, wouldn't you know it, in the On Next tab, I had it do a Screen.Next after validation of path, which would go to the Install Complete screen, and at the same time copy the manuals to the proper place. Well, with this change, it never ran the rest of my script. Actually, this is better because now the Install Complete screen won't show up until the file.copy process is complete. I guess there are both pros and cons to upgrading, huh?

    Thanks,

    Parallon

Similar Threads

  1. Update
    By arnaud in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 11-25-2003, 09:15 AM
  2. Problem with Update Patch
    By tbybee in forum AutoPlay Media Studio 4.0
    Replies: 1
    Last Post: 09-30-2002, 09:18 AM
  3. Setup Factory 6.0.1.0 Update Available
    By Brett in forum Setup Factory 6.0
    Replies: 0
    Last Post: 04-26-2002, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Indigo Rose Software