<commit_before>package installers;


import neko.FileSystem;
import neko.io.Path;
import neko.io.Process;
import neko.Lib;
import neko.Sys;
import data.Asset;


class DesktopInstaller extends InstallerBase {
	
	
	private var targetDir:String;
	private var targetName:String;
	
	
	override function build ():Void {
		
		var hxml:String = targetDir + "/haxe/" + (debug ? "debug" : "release") + ".hxml";
		
		runCommand ("", "haxe", [ hxml ] );
		
		var exe = getExeDir () + "/" + getExeName();
		
		copyResultTo(exe);
		
		if (!InstallTool.isWindows) {
			
			runCommand ("", "chmod", [ "755", exe ]);
			
		} else {
			
			// Setting the icon overwrites this appended neko data - must reverse this...
			
			if (getVM () != "neko") {
				
				icons.setWindowsIcon (defines.get ("APP_ICO"), targetDir + "/haxe", exe);
				
			}
			
		}
		
	}
	
	
	private function copyResultTo (inExe:String):Void {
		
		throw "copyResultTo : Not implemented";
		
	}
	
	
	override function generateContext ():Void {
		
		/*if (defines.exists ("NME_64")) {
			
			targetName += "64";
			
		}*/
		
		defines.set ("XML_DIR", defines.get ("XML_DIR") + "/" + targetName);
		compilerFlags.push ("-cp " + targetDir + "/haxe");
		
		super.generateContext ();
		
		updateIcon ();
		
	}
	
	
	private function get64 ():String {
		
		if (defines.exists ("NME_64")) {
			
			return "64";
			
		}
		
		return "";
		<commit_msg>Added Haxe preprocessor "windows", "mac" and "linux" defines for the C++ and Neko targets<commit_after>package installers;


import neko.FileSystem;
import neko.io.Path;
import neko.io.Process;
import neko.Lib;
import neko.Sys;
import data.Asset;


class DesktopInstaller extends InstallerBase {
	
	
	private var targetDir:String;
	private var targetName:String;
	
	
	override function build ():Void {
		
		var hxml:String = targetDir + "/haxe/" + (debug ? "debug" : "release") + ".hxml";
		
		runCommand ("", "haxe", [ hxml ] );
		
		var exe = getExeDir () + "/" + getExeName();
		
		copyResultTo(exe);
		
		if (!InstallTool.isWindows) {
			
			runCommand ("", "chmod", [ "755", exe ]);
			
		} else {
			
			// Setting the icon overwrites this appended neko data - must reverse this...
			
			if (getVM () != "neko") {
				
				icons.setWindowsIcon (defines.get ("APP_ICO"), targetDir + "/haxe", exe);
				
			}
			
		}
		
	}
	
	
	private function copyResultTo (inExe:String):Void {
		
		throw "copyResultTo : Not implemented";
		
	}
	
	
	override function generateContext ():Void {
		
		/*if (defines.exists ("NME_64")) {
			
			targetName += "64";
			
		}*/
		
		defines.set ("XML_DIR", defines.get ("XML_DIR") + "/" + targetName);
		
		compilerFlags.push ("-D " + targetName);
		compilerFlags.push ("-cp " + targetDir + "/haxe");
		
		super.generateContext ();
		
		updateIcon ();
		
	}
	
	
	private function get64 ():String {
		
		if (defines.exists ("NME_64")) {
			
			return "64";
			
		}
		
		return "";
		
{'fraction_non_alphanumeric': 0.15360824742268042, 'fraction_numerical': 0.008934707903780068, 'mean_word_length': 2.7416452442159382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5446892', 'n_tokens_mistral': 1246, 'n_tokens_neox': 970, 'n_words': 234}