/*
 * * * Compile_AHK SETTINGS BEGIN * * *

[AHK2EXE]
Exe_File=%In_Dir%\..\CreationLanceur.exe
[VERSION]
Set_Version_Info=1
Company_Name=Framasoft
File_Description=Création du lanceur de la WebApp
File_Version=1.0.0.0
Inc_File_Version=0
Internal_Name=CreationLanceur.ahk
Legal_Copyright=(c) 2010 Framakey.org
Original_Filename=CreationLanceur
Product_Version=1.0.48.5
Set_AHK_Version=1
Language_ID=56
[ICONS]
Icon_1=%In_Dir%\CreationLanceur.ico
Icon_2=0
Icon_3=0
Icon_4=0
Icon_5=0
Icon_6=0
Icon_7=0

* * * Compile_AHK SETTINGS END * * *
*/

; ================================================================================
; 								CreationLanceur 1.0.0.0
; ================================================================================
;
; 	Par fat115
; 	License : GNU/GPL
; 	Ce script permet de créer le lanceur de la WebApp avec une icône personnalisée
; 	sans autre outil que ceux fournis
; 	Compiler: AutoHotkey (http://www.autohotkey.com/).
; 	$id=CreationLanceur.ahk $date=2010-02-27
;
; --------------------------------------------------------------------------------
;						Copyright (C) 2010 Framakey

;						Website: http://www.framakey.org

;This software is OSI Certified Open Source Software.
;OSI Certified is a certification mark of the Open Source Initiative.

;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.

;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA	02110-1301, USA.
; --------------------------------------------------------------------------------


; ================================================================================
; 								Initialisation
; ================================================================================

; On désactive l'icône de la barre des tâches
#NoTrayIcon
#NoEnv
SetWorkingDir %A_ScriptDir%

f_Compiler := A_ScriptDir . "\Tools\Ahk2Exe.exe"
f_UPX := A_ScriptDir . "\Tools\upx330.exe"

IniRead, s_LaunchName, ..\App\AppInfo\appinfo.ini, Control, Start, WebAppPortable.exe

If FileExist("..\App\AppInfo\appicon48.ico")
	f_IconFile := A_ScriptDir . "\..\App\AppInfo\appicon48.ico"
Else
	{
		FileSelectFile, f_IconFile, 1, ..\, Veuillez choisir l'icône à utiliser :, Icônes (*.ico)
		If f_IconFile =
			f_IconFile := A_ScriptDir . "\Tools\WebAppPortable.ico"
	
	}

RunWait, %comspec% /c taskkill /im %s_LaunchName% /F , ,Hide
	
RunWait, %f_Compiler% /in WebAppPortable.ahk /out ..\..\%s_LaunchName% /icon "%f_IconFile%", %A_ScriptDir%\Tools, Hide
If ErrorLevel
	MsgBox, 16, Erreur !, Le lanceur n'a pu être créé., 3
Else
	{
	SplashTextOn,320,30,Et voilà !, Le lanceur est maintenant à la racine.
	Sleep, 1000
	SplashTextOff
	}



