Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109

    writing eula data away

    what's wrong with this code??

    it has to try another methode if the previous methode failed

    Code:
    INIFile.SetValue(WindowsFolder.."\\"..Name.." Eula 1.0.0.dat", "Eula", "Accepted Eula? 1 means yes ", "1");
    val = INIFile.GetValue(_WindowsFolder.."\\"..Name.." Eula 1.0.0.dat", "Eula", "Accepted Eula? 1 means yes ");
    
    if (val == "") then
    Registry.SetValue(HKEY_CURRENT_USER, "Software\\"..Name.." Eula 1.0.0", "Accepted Eula? 1 means yes", "1", REG_DWORD);
    val1 = Registry.GetValue(HKEY_CURRENT_USER, "Software\\"..Name.." Eula 1.0.0", "Accepted Eula? 1 means yes", true);
    elseif (val == "1") then
    Page.Jump("Encrypt");
    
    
    if (val1 == "") then
    INIFile.SetValue(ProgramFolder.."\\"..Name.." Eula 1.0.0.dat", "Eula", "Accepted Eula? 1 means yes ", "1");
    val2 = INIFile.GetValue(ProgramFolder.."\\"..Name.." Eula 1.0.0.dat", "Eula", "Accepted Eula? 1 means yes ");
    elseif (val1 == "1") then
    Page.Jump("Encrypt");
    
    
    if (val2 == "") then
    Dialog.Message("Error", "There was an error writing the eula data. Try it again with Administrator rights.\r\n\r\n                                             The application will now terminate.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1)
    Application.Exit(0);
    elseif (val2 == "1") then
    Page.Jump("Encrypt");
    end
    end
    end

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    your if/else/end sturcture is wrong

    it must be
    Code:
    if something then
    
    elseif somethingelse then
    
    elseif somethingelse2 then
    
    end-- notice, only 1 end for the whole block
    you have
    Code:
    if something then
    
    elseif somethingelse then
    
    if something then
    
    
    end
    end
    see the problem ?, you have a block within a block

    also, i would stay away from the registry for data like this, you are sure to run into problems, store the data in a common unprotected ares like application data folders and you will not have any problems, since iv had vista iv noticed a few bugs in some of my apps where im storeing data in the app folder or registry
    Last edited by RizlaUK; 02-07-2009 at 07:41 PM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109
    tried that one already but still no good

  4. #4
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by limboo View Post
    tried that one already but still no good
    Well Gordon Freeman, I saw an example like this on amsuser.com, Check it out. It uses an INI as well.

  5. #5
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109
    first it is gregory freeman
    second what is the name of that project?

Similar Threads

  1. EXAMPLE: Sharing Data between Two Apps without writing to Registry or HD
    By Worm in forum AutoPlay Media Studio 7.5 Examples
    Replies: 14
    Last Post: 11-05-2010, 10:53 AM
  2. Bug? ComboBox Data with "Rename resource files"
    By rep in forum AutoPlay Media Studio 7.5 Suggestions
    Replies: 1
    Last Post: 05-27-2008, 10:36 AM
  3. Edit Text and Add Data
    By Neopolian in forum Setup Factory 7.0
    Replies: 14
    Last Post: 01-12-2008, 06:37 AM
  4. Replies: 0
    Last Post: 06-22-2003, 06:47 AM
  5. INFO: Why Files are Renamed in the DATA Folder
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 03:36 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