Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    2

    Disable Autorun if Registry Key Exists.

    I am trying to get Autoplay Media studio to NOT run if it detects a given registery key and value.

    so basically i want to check to see if the registry value exists, determine what the value is, and if it is less than the version on the CD, the software will run. If it is equal to or greater, the autorun will not be displayed and/or and message will be displayed stating that they already have this software.

    I have played with a few different examples i have found, and am starting to get frustrated.

    Also, od i want to put this script in the preload area of my first page, or on the onstartup area of the project?

    I do not want to use the run once feature, in case the user inserts the disc and has problems/questions and does not proceed.

  2. #2
    Join Date
    Jun 2002
    Location
    Southeast USA
    Posts
    1,804
    Why not build a tiny second program using AMS, and make that the autostarting EXE? That way, it will surely autorun every time, but you can have IT check for the registry key - if it doesn't exist, launch the main program EXE and quit. If it does exist, just quit!
    Eric Darling
    eThree Media
    http://www.ethreemedia.com

  3. #3
    Join Date
    Jun 2004
    Posts
    2
    How would i go about specifiying it as greater than or equal to? is that possible in that syntax?

    thanks for the help so far.

  4. #4
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Try this:


    --place a text file in your docs folder with your verson #
    --When the CD 1st starts place your verson # in the reg.
    cd_ver = TextFile.ReadToString("AutoPlay\\Docs\\ver.txt");

    Registry.SetValue(HKEY_LOCAL_MACHINE, "Software\\whatever\\whatever", "ver", cd_ver, REG_SZ);

    cd_ver = TextFile.ReadToString("AutoPlay\\Docs\\ver.txt");

    ------------------------------Another Page-------------------------
    --check for the key
    reg_ver = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\whatever\\whatever", "ver", true);
    if reg_ver == "" then --the key was empty or does not exist
    --Do somthing here
    else
    ver_compare = String.CompareFileVersions(cd_ver, reg_ver);
    if ver_compare == 0 then -- same version
    end
    elseif ver_compare == 1 then -- cd_ver is greater than the last used version

    --do somthing here, I killed the reg. to then write a new one then jumped to page 2
    Registry.DeleteKey(HKEY_LOCAL_MACHINE, "Software\\whatever");
    Page.Jump("Page2");
    end
    end


    I took this out of another project I was working on with TJ Tigger . I haven't tested it, but it will give you an idea of where we went with it.

Similar Threads

  1. Disable Autorun programatically
    By Willis in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 05-12-2004, 05:07 PM
  2. FYI: Registry key used for AMS File open HTTP:
    By kpsmith in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 10-28-2003, 08:47 AM
  3. Replies: 7
    Last Post: 06-17-2003, 03:55 AM
  4. How to merge registry key file?
    By morci in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 11-24-2002, 12:04 PM
  5. How to extract a file path from registry key?
    By skids in forum AutoPlay Menu Studio 3.0
    Replies: 0
    Last Post: 03-17-2002, 10:48 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