Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by zak666 · Sep 01, 2019 at 03:54 PM · scripting problem

failed to create file? (trying to create a launcher.) Failed To create File.

Ok so i've been trying to create my own game launcher, shouldn't be that hard :) www download and save a folder from my webserver and save it to the folder that my launcher is in then Launch the game. this is the error print I am getting can anyone tell me whats wrong? )

MyLogFile:

Begin MonoManager ReloadAssembly - Completed reload, in 0.992 seconds Initializing input.

Input initialized.

Initialized touch support.

UnloadTime: 0.712412 ms ArgumentException: Failed to create file C:/Users/zak/Desktop/DarkDivide/Launcher/Launcher_Data at (wrapper managed-to-native) UnityEngine.Networking.DownloadHandlerFile.Create(UnityEngine.Networking.DownloadHandlerFile,string,bool) at UnityEngine.Networking.DownloadHandlerFile.InternalCreateVFS (System.String path, System.Boolean append) [0x0001e] in C:\buildslave\unity\build\Modules\UnityWebRequest\Public\DownloadHandler\DownloadHandler.bindings.cs:232 at UnityEngine.Networking.DownloadHandlerFile..ctor (System.String path) [0x0000a] in C:\buildslave\unity\build\Modules\UnityWebRequest\Public\DownloadHandler\DownloadHandler.bindings.cs:237 at DonloadGameUpdate+d__10.MoveNext () [0x00036] in C:\Users\zak\Documents\Galactic-Divide-MMO\Assets\Scripts\DonloadGameUpdate.cs:79 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in :0 UnityEngine.MonoBehaviour:StartCoroutineManaged2(IEnumerator) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) DonloadGameUpdate:Start() (at C:\Users\zak\Documents\Galactic-Divide-MMO\Assets\Scripts\DonloadGameUpdate.cs:23)

(Filename: Line: 0)

Setting up 2 worker threads for Enlighten. Thread -> id: 37ec -> priority: 1 Thread -> id: 3c84 -> priority: 1

MY CS Script:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using System.Diagnostics;
 using System.IO;
 using UnityEngine.Networking;
 public class DonloadGameUpdate : MonoBehaviour
 {
 
     float Download;
     float DownloadMAx = 100;
     public Image DownloadBarPercent;
     public string GameToLoadEXEPath;
     public bool UpdateDownloaded;
     public string GameURLDownload;
 
     public void Start()
     {
         GameToLoadEXEPath = Application.dataPath; /// where my game has been installed....
         DownloadingUpdateYay();
         Main();  // Delete Old Game Folder.....
         StartCoroutine(DownloadingUpdateYay());
 
     }
 
 
 
 
 
     public static void Main()
     {
             var hi = Directory.GetFiles(Application.dataPath + "/Build");
 
             for (int i = 0; i < hi.Length; i++)
             {
                 File.Delete(hi[i]);
             }
 
     }
 
 
 
 
 
 
 
     // Update is called once per frame
     void Update()
     {
         DownloadBarPercent.fillAmount = Download / DownloadMAx;
     }
 
 
 
     private IEnumerator DownloadingUpdateYay()
     {
         yield return DownloadNewVersion();
 
         if (!UpdateDownloaded)
         {
             print("Downloaing....");
         }
         else
         {
             Process mProcess = new Process();
             mProcess.StartInfo.FileName = GameToLoadEXEPath + "/Build.exe";  // Path to load here....
             mProcess.Start();
             Application.Quit();
         }
     }
 
 
     // downlaod New Version of Game ;).........
 
     private IEnumerator DownloadNewVersion()
     {
         var uwr = new UnityWebRequest(GameURLDownload);
         uwr.downloadHandler = new DownloadHandlerFile(GameToLoadEXEPath);
         yield return uwr.SendWebRequest();
         if (uwr.isNetworkError || uwr.isHttpError)
             print("Error downloading your Game....");
         else
             print("GAME DOWNLOWNED....");
 
     }
 
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Eltayeb · Aug 24, 2021 at 12:34 PM

Hello Did you find a way to solve this issue ?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by DirtyFred · Apr 28 at 10:45 AM

I have the same issue. Did anyone find a solution? I get this error randomly and i cant even the " yield return loader.SendWebRequest();" into a try catch....

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

192 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Need help In creating android game with UI buttons ?Please Help 1 Answer

Scripts not updating the material's shader properties 1 Answer

Flip between 2 states constantly C#? 1 Answer

In-Game Tutorial with special actions in special areas. (Shooter) 0 Answers

why if i load a level with ServerChangeScene there spawn dozens of scenes 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges