Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173

    Grin what is wrong with this script??

    Guys

    I am rewriting all the actions of an AMS4 proj that i decided to bring to the great AMS5. Now, as everybody else, i found out that i need to learn from scratch, since the scripting engine has changed (Dear IR friends, i am sure you could build an action converter for this!!!... Please consider....) Anyway. Here is a script that check if a registry key exist and if not it create folders. It doesnt work at all so if anyone can tell me what is wrong with that, i will be an happy man .

    SCDExist = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\DAZTools");

    --
    if SCDExist == "FALSE" then
    --Dialog.Message(Copying files, "The \"DAZTools\" needs to copy some files on the Hard drive in order for the utilities to work. (required!). The files are less than 2mb and will be copied to: SCDPath\r\n\r\nPress OK when ready!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1)
    --
    --
    --Creating folders
    --
    Folder.Create("SCDPath\Bin");
    Folder.Create("SCDPath\Temp");
    --
    --
    Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\DAZTools");
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\DAZTools", "SCDRoot", "C:\DAZTools", REG_SZ);
    end



    Note: even when i create all my action using the action wizard, i am getting script errors when i preview my project.....


    thanks

    Martin

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    True and False don't have to be in Quotes anymore, but they do need to be in lower case. Also remember to double up on the backslash in file paths etc...

    Code:
    SCDExist = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\DAZTools"); 
    
    -- 
    if not SCDExist then 
    --Dialog.Message(Copying files, "The \"DAZTools\" needs to copy some files on the Hard drive in order for the utilities to work. (required!). The files are less than 2mb and will be copied to: SCDPath\r\n\r\nPress OK when ready!", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1) 
    -- 
    -- 
    --Creating folders 
    -- 
    Folder.Create(_SourceFolder.."\\SCDPath\\Bin"); 
    Folder.Create(_SourceFolder.."\\SCDPath\\Temp"); 
    -- 
    -- 
    Registry.CreateKey(HKEY_LOCAL_MACHINE, "Software\\DAZTools"); 
    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\DAZTools", "SCDRoot", "C:\\DAZTools", REG_SZ); 
    end

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    After reading through the code again, I think you have the path to your app stored in a variable named SCDPath

    If that's true, change the Folder.Create lines to this:

    Folder.Create(SCDPath.."\\Bin");
    Folder.Create(SCDPath.."\\Temp");

  4. #4
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    Thanks Worm

    I hope i will get into the new script engine and become familiar with all the details and gotchas very soon!


    You've been a great help as usual


    Martin

  5. #5
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    in this case I think you also have to use double-backslash

    SCDExist = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\DAZTools");

    SCDExist = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\DAZTools");



    See Online-help:
    Scripting guide
    -- Variables
    -----Variable Scope
    --------Local Variables
    -----------String

    Stefan

  6. #6
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    Yeah, thanks dude i found it after Worm's reply!

Posting Permissions

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