$install_dir = $PSScriptRoot + "\������װ��"

if(Test-Path $install_dir )
{
	rm -Recurse -Force $install_dir
}

mkdir $install_dir


#���� install\* �� ������װ��
$files = ("��ɽ�з������Զ����������޹�˾", "FLY.Install.exe", "install_AirRing.xml")
foreach($f in $files)
{
    cp -Recurse ($PSScriptRoot + "\install\"+$f) $install_dir
}

mv ($install_dir + "\install_AirRing.xml") ($install_dir + "\install.xml")


$install_dir = $install_dir+"\��ɽ�з������Զ����������޹�˾\windows"

function copy_to($src_dir , $project_name, $other )
{

	$src_dir = $PSScriptRoot + "\..\" + $src_dir
	$dest_dir = $install_dir + "\" + $project_name

	#����ļ����Ƿ����
	#���ڣ�ɾ��ȫ�����ݣ����´�����
	#�����ڣ�������
	
	if(Test-Path $dest_dir )
	{
		rm -Recurse -Force $dest_dir
	}
	mkdir -p $dest_dir
	
	echo ���� $project_name

	#����ȫ�� xxx.dll �� $project_name+".exe"
	cp ($src_dir + "\*.dll") $dest_dir
	cp ($src_dir + "\*.exe") $dest_dir

	#ɾ�� *.vshost.exe
	rm ($dest_dir + "\*.vshost.exe"	)

    #��������
	foreach($f in $other)
	{
		cp -Recurse ($src_dir + "\"+$f) $dest_dir
	}
}

copy_to `
"Project.FLY.Thick.Blowing\FLY.Thick.Blowing.UI.Fix.Client\bin\Debug" `
"FLY.Thick.Blowing.UI.Fix.Client" `
("csysparam.xml","layout", "main_module", "music", "�汾˵��.txt", "�����˵����.pdf")

copy_to `
"Project.FLY.Thick.Blowing\FLY.Thick.Blowing.UI.Fix.Server\bin\Debug" `
"FLY.Thick.Blowing.UI.Fix.Server" `
("Gage1")

copy_to `
"Project.FLY.FeedbackRenZiJia\FLY.FeedbackRenZiJia.UI.Server\bin\Debug" `
"FLY.FeedbackRenZiJia.UI.Server" `
("Gage1")

echo ���Ƴɹ� 
pause