如何将Unity3D 5 Windows应用程序打包到单个exe文件中? [英] How Can I Package a Unity3D 5 Windows Application into a single exe file?

查看:957
本文介绍了如何将Unity3D 5 Windows应用程序打包到单个exe文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Unity3d开发的新手.我创建了两个版本的3D拼图应用程序,一个用于Mac,另一个用于Windows. Mac应用程序是使用其中包含的包装内容创建的. Windows应用程序是使用exe文件和与exe文件+后缀_Data同名的单独的数据文件夹创建的.我想创建一个单独的exe文件,以便在Amazon和其他可下载平台上分发.我遇到的问题是找到一些数据文件夹和exe文件必须位于同一级别的地方.

我已经习惯了Apple设备,但是最近购买了Windows笔记本电脑进行测试.

我在Unity3D文档中找不到有关如何执行此操作的任何内容.文档讨论了如何将应用程序分发到Windows应用商店,这是我不打算做的事情.我在他们的论坛上唯一能找到的是 Smart Packer Pro 的试用版,但是我需要一个dll文件作为起点我在Unity3D项目文件夹中找不到.

我发现与Windows打包到一个exe文件中有关的所有信息都至少有五年的历史.它们都与打包Unity3D应用程序无关.我也搜索了microsoft.com和windows.com,但在那里找不到任何内容.

更新5/12/2016 14:15

我安装了Inno Setup,并尝试为我的应用程序创建脚本.它复制了exe文件,但创建了一个空的数据文件夹,而不是复制我需要运行exe文件的数据文件夹.我检查以确保脚本中的文件夹名称正确.

; -- myapplication.iss --
; Demonstrates copying 3 files and creating an icon.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
AppName=myapplication
AppVersion=1.0 
DefaultDirName={pf}\myapplication
DefaultGroupName=myapplication
UninstallDisplayIcon={app}\myapplication.exe
Compression=lzma2
SolidCompression=yes 
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: "myapplication.exe"; DestDir: "{app}"    

[Dirs]
Name: "{app}\myapplication_Data";

解决方案

没有第三方软件,不可能打包Unity3D应用程序.

近期的网址(2014)建议使用智能打包器,但这是我个人从未使用过的工具. /p>

我倾向于使用 inno设置,因为它看起来更专业一些,可以简化文件移动,创建链接(快捷方式)并进行大量卸载.简而言之,这使您可以将exe和_data文件夹提取到同一文件夹,并创建该exe的快捷方式.

继续编辑

我安装了Inno Setup,并尝试为我的应用程序创建脚本.它复制了exe文件,但创建了一个空的数据文件夹,而不是复制我需要运行exe文件的数据文件夹.我检查以确保脚本中的文件夹名称正确.

在安装向导的application files部分中选择了主要的exe文件之后,您可以添加一个文件夹.在这里,您可以选择要包含在安装程序中的yourgame_data文件夹.但是,这确实需要额外的步骤.添加文件夹后,需要将destination subfolder设置为yourgame_data才能正确创建子目录.您可以参考此图片指南以了解更多信息信息.我在下面列出了相关步骤.

I am new to Unity3d development. I have created two versions of a 3D puzzle app, one for Mac and the other for Windows. Mac applications are created with the package contents contained within it. The Windows application is created with the exe file and a separate data folder with the same name as the exe file + suffix _Data. I want to create a single exe file to distribute on Amazon and other downloadable platforms. The problem I'm having is finding something where the data folder and the exe file have to be located at the same level.

I'm used to Apple devices but recently purchased a Windows laptop for testing.

I could not find anything in the Unity3D documentation on how to do this. The documentation talks about how to distribute the application to the Windows Store, something I don't plan to do. The only thing I could find on their forum was one question that was asked in 2011.

One of the suggested solutions, Enigma Virtual Box, I could not get to work because Unity3D requires that the exe file and the data folder be at the same level. I have also tried the trial for Smart Packer Pro but I need a dll file as a starting point which I could not find in my Unity3D project folder.

All of the information I'm finding related to Windows packaging into a single exe file are at least five years old. None of them relate to packaging Unity3D applications. I have also searched microsoft.com and windows.com but could not find anything there.

UPDATE 5/12/2016 14:15

I installed Inno Setup and attempted to create a script for my application. It copied the exe file but created an empty data folder instead of copying the data folder I need to run the exe file. I checked to make sure that the folder name was correct in the script.

; -- myapplication.iss --
; Demonstrates copying 3 files and creating an icon.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
AppName=myapplication
AppVersion=1.0 
DefaultDirName={pf}\myapplication
DefaultGroupName=myapplication
UninstallDisplayIcon={app}\myapplication.exe
Compression=lzma2
SolidCompression=yes 
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: "myapplication.exe"; DestDir: "{app}"    

[Dirs]
Name: "{app}\myapplication_Data";

解决方案

Packing a Unity3D application is not not possible without 3rd party software.

a bit more recent url (2014) suggests using smart packer, this however is a tool I personally never used before.

I tend to use inno setup as it seems a bit more professional, it eases up moving files, creating links (short-cuts) and uninstalling quite a bit as well. Simply said, this allows you to extract the exe and _data folder to the same folder, and create a shortcut to the exe.

Follow up on edit

I installed Inno Setup and attempted to create a script for my application. It copied the exe file but created an empty data folder instead of copying the data folder I need to run the exe file. I checked to make sure that the folder name was correct in the script.

After selecting the main exe file during the application files part of the setup wizard, you can add a folder. Here you can select yourgame_data folder to be included in the installer. This however does require an additional step. After adding the folder, you need to set the destination subfolder to yourgame_data for it to be able to properly create the subdirectories. You can refer to this picture guide for more information. I included the relevant step(s) below.

这篇关于如何将Unity3D 5 Windows应用程序打包到单个exe文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆