Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by edmiester777 · Dec 24, 2013 at 12:35 AM · c#buildbuild-errorzip

Unable To Unzip File After Build

Hello, I have a simple unzip class built and it works fine while I test in the editor, but once it is built, it appears that the script will not run. Here is some code I have. I am using the Ionic.zip.dll.

ZipHelper.cs:

 using UnityEngine;
 using System.Collections;
 using Ionic.Zip;
 
 public class ZipHelper {
     public static string ExtractZip(string filePath, string destFolder){
         using(ZipFile zip = ZipFile.Read(filePath)){
             // extracting entries
             foreach(ZipEntry z in zip){
                 z.Extract(destFolder, ExtractExistingFileAction.OverwriteSilently);
             }
         }
     }
 }
 

Where It Is Called:

 ZipHelper.ExtractZip(DirectoryHelper.getDownloadPath() + "/forgesrc.zip", Directory.GetCurrentDirectory());

I have already tried running the program as administrator to avoid any r/w issues. This does not work either, but the referenced DLL does appear to be loading fine in the log file. No other errors or weird events show up in the log file so i am about as confused as i can get.

Comment
Add comment · Show 4
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 robertbu · Dec 24, 2013 at 12:49 AM 0
Share

Note the folders inside your Assets folder don't exist in a build.

avatar image edmiester777 · Dec 24, 2013 at 03:52 AM 0
Share

yes, the directory is made and filled after the program starts. it does not need to compile with the directories

avatar image robertbu · Dec 24, 2013 at 05:05 AM 0
Share

I doubt this is the problem, but consider using Application.persistentDataPath as the location.

avatar image edmiester777 · Dec 24, 2013 at 03:14 PM 0
Share

i just tried, but still no luck. It is weird because i know its not the dll anymore because i got the source code of sharpziplib and used that with no luck. Unfortunately it looks like it is just an inability to open the zip file. the script breaks right at the "using(ZipFile zip = ZipFile.Read(filePath)){" line.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by edmiester777 · Dec 26, 2013 at 05:24 AM

Well I Figured out the problem if anyone has an issue with dll imports not working after build, 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

Comment
Add comment · Show 1 · 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 KittyCrafting · Dec 24, 2013 at 12:47 AM

is forgesrc.zip in the same folder as the program? or it could mean in your local disk.

Comment
Add comment · Show 1 · 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 edmiester777 · Dec 24, 2013 at 03:02 AM 0
Share

Well it downloads into a folder next to the exe file. That folder is called downloads. Should i make it download to the resources folder? The directory is created when the application starts, and that works fine, downloading the file works, its just the unzipping that doesn't work.

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

20 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

Related Questions

Distribute terrain in zones 3 Answers

Build error when using BooleanOps.dll 1 Answer

Multiple Cars not working 1 Answer

Audio Mixer Snapshots not transitioning properly after build,Audio Snapshots not transitioning properly after build. 0 Answers

Can't Build PC Standalone due to multiple namespace script errors but playable in editor 1 Answer


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