Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

Get Appfolder from INI or Registry

$
0
0
Hi there, i try to get and set Appfolder for Setup - but it didn't work if i want

On Startup it should get a Path from INI File. If INI is not available try it from Registry and if Reg is also not available then use current dir.

This is what i've tryed...

Code:
local mypath = INIFile.GetValue(_WindowsFolder .. "\\myprog.ini", "testpath", "path");

     if (error ~=0) or (mypath == "") then
          local mypath = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\MyProg", "path");

               if (error ~=0) or (mypath == "") then
                   local mypath = Folder.GetCurrent( );
                   SessionVar.Set("%Appfolder%", mypath);
               else
                   SessionVar.Set("%Appfolder%", mypath);
               end
     else
          SessionVar.Set("%Appfolder%", mypath);
     end

Viewing all articles
Browse latest Browse all 2105

Trending Articles