public void CreateArchive(string mutatorPath, bool hideFromModList = false)
		{
			var script = GetScript();
			var modInfo = GetModInfo(hideFromModList);
			var luaMissionData = SerializeToLua();
			if (Debugger.IsAttached)
			{
				File.WriteAllText("startscript.txt", script);
				File.WriteAllText("modinfo.txt", modInfo);
				//File.WriteAllText("mission.lua", luaMissionData);
			}
			var textEncoding = Encoding.GetEncoding("iso-8859-1"); // ASCIIEncoding()
			using (var zip = new ZipFile())
			{
				if (!String.IsNullOrEmpty(ContentFolderPath) && Directory.Exists(ContentFolderPath)) zip.SafeAddDirectory(ContentFolderPath);

				var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
				var basePath = Path.Combine(assemblyLocation, "MissionBase");
				zip.SafeAddDirectory(basePath);

				zip.SafeAddEntry("modinfo.lua", textEncoding.GetBytes(modInfo));
				zip.SafeAddEntry("mission.lua", textEncoding.GetBytes(luaMissionData));
				zip.SafeAddEntry("script.txt", textEncoding.GetBytes(script));
				zip.SafeAddEntry(GlobalConst.MissionScriptFileName, textEncoding.GetBytes(script));
				zip.SafeAddEntry("slots.lua", textEncoding.GetBytes(GetLuaSlots().ToString()));
				zip.SafeAddEntry("dependencies.txt", String.Join(";", Mod.Dependencies)); // FIXME

				{
					var stream = new MemoryStream();
					using (var writer = XmlWriter.Create(stream, new XmlWriterSettings { Indent = true, CheckCharacters = true })) new NetDataContractSerializer().WriteObject(writer, this);
					stream.Position = 0;
					zip.SafeAddEntry("project.mission.xml", stream);
				}

				{
					var serializer = new XmlSerializer(typeof(List<MissionSlot>));
					var stream = new MemoryStream();
					serializer.Serialize(stream, GetSlots());
					stream.Position = 0;
					zip.SafeAddEntry(GlobalConst.MissionSlotsFileName, stream);
				}

				// disable scripts by hiding them with a blank file
				var blank = textEncoding.GetBytes("-- intentionally left blank --");
				foreach (var widget in disabledWidgets.Distinct()) zip.SafeAddEntry("LuaUI/Widgets/" + widget, blank);
				foreach (var gadget in disabledGadgets.Distinct()) zip.SafeAddEntry("LuaRules/Gadgets/" + gadget, blank);

				// include media in mod archive
				foreach (var item in AllLogic)
				{
                    // note we want a silent failure if file not found (with the new read-from-archive system it often won't fail anyway)
					if (item is GuiMessageAction)
					{
						var action = (GuiMessageAction)item;
						if (!String.IsNullOrEmpty(action.ImagePath))
						{
							if (File.Exists(action.ImagePath)) zip.SafeAddFile(action.ImagePath, "LuaUI/Images/");
						}
					}
                    else if (item is GuiMessagePersistentAction)
                    {
                        var action = (GuiMessagePersistentAction)item;
                        if (!String.IsNullOrEmpty(action.ImagePath))
                        {
                            if (File.Exists(action.ImagePath)) zip.SafeAddFile(action.ImagePath, "LuaUI/Images/");
                        }
                    }
                    else if (item is ConvoMessageAction)
                    {
                        var action = (ConvoMessageAction)item;
                        if (!String.IsNullOrEmpty(action.ImagePath))
                        {
                            if (File.Exists(action.ImagePath)) zip.SafeAddFile(action.ImagePath, "LuaUI/Images/");
                        }
                        if (!String.IsNullOrEmpty(action.SoundPath) && File.Exists(action.SoundPath))
                        {
                            if (File.Exists(action.SoundPath)) zip.SafeAddFile(action.SoundPath, "LuaUI/Sounds/convo");
                        }
                    }
                    else if (item is SoundAction)
                    {
                        var action = (SoundAction)item;
                        if (!String.IsNullOrEmpty(action.SoundPath) && File.Exists(action.SoundPath))
                        {
                            if (File.Exists(action.SoundPath)) zip.SafeAddFile(action.SoundPath, "LuaUI/Sounds/");
                        }
                    }
                    else if (item is MusicAction)
                    {
                        var action = (MusicAction)item;
                        if (!String.IsNullOrEmpty(action.TrackPath) && File.Exists(action.TrackPath))
                        {
                            zip.SafeAddFile(action.TrackPath, "LuaUI/Sounds/music/");
                        }
                    }
                    else if (item is MusicLoopAction)
                    {
                        var action = (MusicLoopAction)item;
                        if (!String.IsNullOrEmpty(action.TrackIntroPath) && File.Exists(action.TrackIntroPath))
                        {
                            zip.SafeAddFile(action.TrackIntroPath, "LuaUI/Sounds/music/");
                        }
                        if (!String.IsNullOrEmpty(action.TrackLoopPath) && File.Exists(action.TrackLoopPath))
                        {
                            zip.SafeAddFile(action.TrackLoopPath, "LuaUI/Sounds/music/");
                        }
                    }
				}
                string directory = Path.GetDirectoryName(mutatorPath);
                if (!Directory.Exists(directory)) Directory.CreateDirectory(directory);

				zip.Save(mutatorPath);
			}
		}