Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Thanks Gideros Player! — Gideros Forum

Thanks Gideros Player!

hgy29hgy29 Maintainer
Hello! I want to share my recent troublesome experience with Windows 10.

It all started last week, when I decided to install VS2019 in order to work on UWP for Gideros from my home computer. It had an old VS2015 installed. Problem’ that old VS was not properly deinstalled, but files where missing to deinstall it properly. VS2019 installer kept picking old cached files no matter what I tried, because of the garbage left in the registry by the previous VS version.
After the third failed attempt, I decided to reinstall W10: it went smoothly and kept my files, and I was able to reinstall everything... to discover in the end that in the Windows Store app went missing!

I tried many ways to repair my Windows installation, and nothing did it. At last, I zipped all my important files, backed them up to an external drive, then reinstalled the whole computer from the factory image. Hooray, store was back! I reinstalled everything, including VS2019 and Gideros, copied back my saved files, just to find out that SOME FILES WERE MISSING!

And of course, those were the most important files: my Gideros projects, including some for which I didn’t have any backup. I had an apk, and could possibly decipher assets, but how to recover compiled lua files ?
Luckily my wife gave me an idea: the last trial on that project was done on my phone, in a player. So the player had those files, unencrypted!
And guess what: you can access files of a project from another project running in the same player, thanks to lfs. I quickly wrote a simple lua program to upload the ‘lost’ files from my phone to a server, using UrlLoader. 30 lines of lua, 10 lines of php, et voilà. My files are now safely on my server! happy end!

+1 -1 (+6 / -0 )Share on Facebook

Comments

  • PaulHPaulH Member
    Wow! Glad to hear you got your source code back! That's a great solution!

    This is off the topic of the player saving the day, but relevant to Visual Studio quirks:

    I had a hassle with Visual Studio's behavior recently. When updating to build UWP, I installed a new Visual Studio, chose to install optional components on a different drive to save space, and found that the Gideros project wouldn't link when VS was installed that way. So I uninstalled and reinstalled, but due to stuff left behind in the registry, it wouldn't ever let me install on a single drive again. My solution was to switch my Windows builds to my laptop, and that's been fine for UWP.

    The only problem is now I can't build for WinRT for Windows 8. When I uninstalled Visual Studio, that removed the build tools for Windows 8, and those tools aren't available in the VS installer anymore. So I can use an older Gideros to export a WinRT project, but I can't install the VS components to build it. UWP is working great for me for Windows 10, but I'm currently unable to update my apps for Windows 8 users.

    Any ideas?

    Paul
  • hgy29hgy29 Maintainer
    For windows 8, your only option is to install an older visual studio, I think it was 2015. It is still available from MS.
  • SinisterSoftSinisterSoft Maintainer
    Your Windows 8 users should just download Windows 10 - it's still free for Windows 8 users to upgrade. (I upgraded a Windows 8 PC about 2 weeks ago)
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • hgy29hgy29 Maintainer
    edited May 2020
    The code I used to recover my files:
    require "lfs"
    local project="MyLostProject"
    local ppath="|D|/../../"..project.."/resource"
     
    function upload(name,data)
    local headers = {
    	["Content-Type"] = "application/binary",
    	["Content-Length"] = #data,
    }
     
    local loader = UrlLoader.new("<a href="https://my.server/upload.php?file="..name" rel="nofollow">https://my.server/upload.php?file="..name</a>
    , UrlLoader.POST, headers, data)
     
    loader:addEventListener(Event.COMPLETE, function(e)
    	print("DONE:"..name,e.data)
    end)
    end
     
    function attrdir (path)
          for file in lfs.dir(ppath..path) do
              if file ~= "." and file ~= ".." then
                  local f = path..file
                  local attr = lfs.attributes (ppath..f)
                  assert (type(attr) == "table")
                  if attr.mode == "directory" then
                      attrdir (f.."/")
                  else
    				  local fc=io.open(ppath..f,"rb")
    				  local fd=fc:read("*all")
    				  fc:close()
    				  print ("\t "..path:sub(2).."\t"..file,attr.size,#fd)
    				  upload(project..path..file,fd)
                  end
              end
          end
      end
     
      attrdir("/")
    And the php part:
    <?php
    function file_put_contents_force(){
        $args = func_get_args();
        $path = str_replace(array('/','\\'), DIRECTORY_SEPARATOR, $args[0]);
        $parts = explode(DIRECTORY_SEPARATOR, $path);
        array_pop($parts);
        $directory =  '';
        foreach($parts as $part):
            $check_path = $directory.$part;
                if( is_dir($check_path.DIRECTORY_SEPARATOR) === FALSE) {
                    mkdir($check_path, 0755);
                }
                $directory = $check_path.DIRECTORY_SEPARATOR;
        endforeach;
        call_user_func_array('file_put_contents',$args);
    }
     
    file_put_contents_force("files/".$_GET["file"], file_get_contents('php://input'));
    ?>

    Likes: SinisterSoft, oleg

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.