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 8 of 8
  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Huh? Strange problem!

    Hi

    I'm trying to copy a primer file to the windows folder. However something strange is happening. If the file already exists it deletes the file without making a backup even though its set to make one.

    But, if the file doesn't exist to start with, it doesnt copy the file over. If I turn off make a backup, then it installs the file to the windows folder ok.

    I need it to make a backup though. Here's the code I'm using.


    Code:
    osresult = System.GetOSName();
    if osresult == "Windows XP" then
    File.Install(SessionVar.Expand("%TempLaunchFolder%\\example.ini"), "%WindowsFolder%\\example.ini", FILE_INSTALL_ALWAYS, true, true);
    end
    So whats happening. Thanks

    Danny Please help, knowones helped so far with my posts.

  2. #2
    Join Date
    Sep 2004
    Posts
    60
    The only thing I see wrong is a syntax error in the destination. Try this and see if it works.

    Code:
    File.Install(_TempLaunchFolder.."\\example.ini"), _WindowsFolder.."\\example.ini", FILE_INSTALL_ALWAYS, true, true);

  3. #3
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    danfloun,
    Why do you tell SUF70 that example.ini is a shared system file? [Set to false]
    You should use the result variable feature and test the result.
    Absynthe has already told that you must use the build-in variable (or expand the session variable). You can never use a session variable as a regular variable.

    It's a good idea to add some error handling
    Code:
    bInstalled = File.Install(SessionVar.Expand("%TempLaunchFolder%\\example.ini"), 
        _WindowsFolder.."\\example.ini", FILE_INSTALL_ALWAYS, false, false);
    nError = Application.GetLastError();
    if nError~= 0 then
         -- some kind of error has occurred!
         Dialog.Message("Error "..nError, "File install error: ".._tblErrorMessages[nError]);
    end
    if bInstalled then
    Dialog.Message("", "Yes, installed");
    else
    	Dialog.Message("", "No, not installed");
    end
    There seems to be a bug when you set CreateBackup = true!

  4. #4
    Join Date
    Feb 2005
    Posts
    7

    Huh?

    Hi,

    thanks for your help.

    I've tried the code suggested to no avail, it does exactly the same.

    Code:
    File.Install(SessionVar.Expand(_TempLaunchFolder.."\\example.ini"), _WindowsFolder.."\\example.ini", FILE_INSTALL_ALWAYS, true, false);
    I can't work it out. If! the file exists, it dissapears after running the sf7.0 exe and it doesn't backup. If the file doesn't exist, it still doesn't create it untill I turn off 'backup

    ?.

  5. #5
    Join Date
    Sep 2004
    Posts
    60
    Sounds like a bug, looks like you willl have to check for the file and rename it yourself.

  6. #6
    SUF6NEWBIE Guest
    Yep, I can confirm this behaviour at my end also
    (also tried the numeric constant of (2) instead of the 'verb'

    makes no difference.

    The same issue is evident in AMSPro 5020

  7. #7
    Join Date
    Feb 2005
    Posts
    7
    Quote Originally Posted by SUF6NEWBIE
    Yep, I can confirm this behaviour at my end also
    (also tried the numeric constant of (2) instead of the 'verb'

    makes no difference.

    The same issue is evident in AMSPro 5020
    Thanks SUF6NEWBIE

    For that info, I'll back up the file manually instead.

    Can the admin post this in BUGS please. Thx

  8. #8
    Join Date
    Aug 2002
    Posts
    9,746
    Hi, there's a reference to it in there, so it should get picked up no problem.

Similar Threads

  1. Strange File.copy problem
    By BillEBob in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 01-16-2004, 09:53 AM
  2. Strange problem
    By darkstar1309 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-27-2003, 12:54 PM
  3. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  5. Simple but strange CD-ROM setup problem
    By Phasar in forum Setup Factory 6.0
    Replies: 8
    Last Post: 01-21-2002, 10:59 AM

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