- Home /
Working in the editor but not standalone?
Hey there, I´m using a plugin to unity called DotNetZip (Ionic.Zip.dll) wich allows me to decompress .zip files in C#. Everything is working just as expected in the editor but when i build it to standalone it freezes at the line 54, where the decompressing begins. I´m running on Windows.
using UnityEngine;
using System.Collections;
using System.Diagnostics;
using System.Net;
using System.IO;
using Ionic.Zip;
public class Updater2 : MonoBehaviour {
public GUIText info;
void Start ()
{
StartCoroutine(Wait());
}
IEnumerator Wait()
{
string latest = "http://www.nexonity.com/data/check.txt";
WWW latest2 = new WWW(latest);
yield return latest2;
if (File.Exists(@"C:\Windows\Temp\FinalWorldWindows\version.txt"))
{
string current = System.IO.File.ReadAllText(@"C:\Windows\Temp\FinalWorldWindows\version.txt");
if (latest2.text == current)
{
StartCoroutine(Wait2());
}
else
{
WebClient webClient = new WebClient();
webClient.DownloadFile("http://nexonity.com/data/FinalWorldWindows.zip", @"C:\Windows\Temp\FinalWorldWindows.zip");
Decompress();
}
}
else
{
WebClient webClient = new WebClient();
webClient.DownloadFile("http://nexonity.com/data/FinalWorldWindows.zip", @"C:\Windows\Temp\FinalWorldWindows.zip");
Decompress();
}
}
void Decompress()
{
string zipToUnpack = @"C:\Windows\Temp\FinalWorldWindows.zip";
string unpackDirectory = @"C:\Windows\Temp";
info.text = "Decompressing";
using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
{
foreach (ZipEntry e in zip1)
{
info.text = "Decompressing 2";
e.Extract(unpackDirectory, ExtractExistingFileAction.OverwriteSilently);
info.text = "Decompressing done";
}
}
StartCoroutine(Wait2());
}
IEnumerator Wait2()
{
yield return new WaitForSeconds(2);
System.Diagnostics.Process.Start(@"C:\Windows\Temp\FinalWorldWindows\FinalWorld.exe");
yield return new WaitForSeconds(2);
Application.Quit();
}
}
Answer by sparkzbarca · Aug 06, 2013 at 05:13 PM
is the standalone build then running in administrator mode I'd be almost positive windows is not cool with you extracting stuff without administrative priv.
my guess is unity is running in admin and allowed to do that stuff adn the standalone isn't
I tried to run it as ad$$anonymous$$ but i still got the same thing :/
Answer by gull · Nov 18, 2014 at 06:33 AM
it is because some dependency dll files are missing from unity's build. Navigate to: C:Program Files (x86)/Unity/Editor/Data/Mono/lib/mono/unity and copy all of the I18N.dlls. This will fix any incompatability issues
Your answer
Follow this Question
Related Questions
Standalone build doesn't create gameobjects properly 1 Answer
Low FPS in editor, but normal FPS in standalone 0 Answers
Works in the editor, but not when I publish it.. what's wrong..? 0 Answers
Different behavior between editor and standalone changing time step 0 Answers
Unity VR (XR) enable/disable VR on startup in Editor and as standalone. 1 Answer