提交 7f8057b1 authored 作者: Mitch Capper's avatar Mitch Capper

Improved setup, fixed missing files in link.pl

上级 7d055604
#!/usr/bin/perl
use strict;
my $FS_BUILD_PATH = "freeswitch.final\\Win32\\Debug";
my $WORKING_DIR = "FSClient\\working";
my $USE_LN = 0; #THIS SHOULD BE SET TO 0 (unless you have an ln equiv for windows)
my $COPY_CONF = 1;
my $VERBOSE = 1;
my $VERBOSE_SYS_RES = 0;
die "Build directory does not exist: $FS_BUILD_PATH" if (! -e $FS_BUILD_PATH);
die "Working directory does not exist: $WORKING_DIR" if (! -e $WORKING_DIR);
my @MAIN_FILES = qw/FreeSwitch.dll libapr.dll libaprutil.dll libbroadvoice.dll libspandsp.dll libteletone.dll mod_managed.dll pthread.dll/;
my @modules = qw/mod_celt mod_commands mod_console mod_dialplan_xml mod_dptools mod_event_socket mod_ilbc mod_local_stream mod_logfile mod_loopback mod_PortAudio mod_siren mod_sndfile mod_sofia mod_speex mod_tone_stream mod_h26x mod_silk/;
my $link_cmd = $USE_LN ? "ln -s -a" : "copy";
sub exec_cmd($){
my ($cmd) = @_;
print $cmd . "\n" if ($VERBOSE);
my $res = `$cmd 2>&1`;
chomp($res);
chomp($res);
$res =~ s/\n/\n\t/g;
print $res . "\n" if ($VERBOSE_SYS_RES);
}
exec_cmd("mkdir " . $WORKING_DIR . "\\mod") if (-e $WORKING_DIR . "\\mod" == 0);
foreach my $module (@modules){
my $rel_path = "mod\\" . $module . ".dll";
next if (-e "$WORKING_DIR\\" . $rel_path && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $rel_path;
if (-e $src_path == 0){
print "Warning: $src_path does not exist\n";
next;
}
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$rel_path"~);
}
foreach my $file (@MAIN_FILES){
next if (-e "$WORKING_DIR\\" . $file && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $file;
$src_path = $FS_BUILD_PATH . "\\mod\\" . $file if (-e $FS_BUILD_PATH . "\\mod\\" . $file); #mainly for putting mod_managed.dll into the root
if (-e $src_path == 0){
print "Warning: $src_path does not exist\n";
next;
}
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$file"~);
}
if ($COPY_CONF){
exec_cmd("mkdir " . $WORKING_DIR . "\\conf") if (-e $WORKING_DIR . "\\conf" == 0);
exec_cmd($link_cmd . qq~ "conf\\freeswitch.xml" "$WORKING_DIR\\conf\\freeswitch.xml"~);
#!/usr/bin/perl
use strict;
my $FS_BUILD_PATH = "freeswitch\\Win32\\Debug";
my $WORKING_DIR = "FSClient\\bin\Debug";
my $USE_LN = 0; #THIS SHOULD BE SET TO 0 (unless you have an ln equiv for windows)
my $COPY_CONF = 1;
my $VERBOSE = 1;
my $VERBOSE_SYS_RES = 0;
die "Build directory does not exist: $FS_BUILD_PATH" if (! -e $FS_BUILD_PATH);
die "Working directory does not exist: $WORKING_DIR" if (! -e $WORKING_DIR);
my @MAIN_FILES = qw/FreeSwitch.dll libapr.dll libaprutil.dll libbroadvoice.dll libspandsp.dll libteletone.dll mod_managed.dll pthread.dll libeay32.dll ssleay32.dll/;
my @modules = qw/mod_celt mod_commands mod_console mod_dialplan_xml mod_dptools mod_event_socket mod_ilbc mod_local_stream mod_logfile mod_loopback mod_PortAudio mod_siren mod_sndfile mod_sofia mod_speex mod_tone_stream mod_h26x mod_silk mod_spandsp mod_bv/;
my $link_cmd = $USE_LN ? "ln -s -a" : "copy";
sub exec_cmd($){
my ($cmd) = @_;
print $cmd . "\n" if ($VERBOSE);
my $res = `$cmd 2>&1`;
chomp($res);
chomp($res);
$res =~ s/\n/\n\t/g;
print $res . "\n" if ($VERBOSE_SYS_RES);
}
exec_cmd("mkdir " . $WORKING_DIR . "\\mod") if (-e $WORKING_DIR . "\\mod" == 0);
foreach my $module (@modules){
my $rel_path = "mod\\" . $module . ".dll";
next if (-e "$WORKING_DIR\\" . $rel_path && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $rel_path;
if (-e $src_path == 0){
print "Warning: $src_path does not exist\n";
next;
}
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$rel_path"~);
}
foreach my $file (@MAIN_FILES){
next if (-e "$WORKING_DIR\\" . $file && $USE_LN);
my $src_path = $FS_BUILD_PATH . "\\" . $file;
$src_path = $FS_BUILD_PATH . "\\mod\\" . $file if (-e $FS_BUILD_PATH . "\\mod\\" . $file); #mainly for putting mod_managed.dll into the root
if (-e $src_path == 0){
print "Warning: $src_path does not exist\n";
next;
}
exec_cmd($link_cmd . qq~ "$src_path" "$WORKING_DIR\\$file"~);
}
if ($COPY_CONF){
exec_cmd("mkdir " . $WORKING_DIR . "\\conf") if (-e $WORKING_DIR . "\\conf" == 0);
exec_cmd($link_cmd . qq~ "conf\\freeswitch.xml" "$WORKING_DIR\\conf\\freeswitch.xml"~);
}
\ No newline at end of file
......@@ -2,14 +2,10 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<ComponentGroup Id="FSClientComp">
<ComponentRef Id="cmp98E16C7E23D449F3BC0ECF003543C3F9"/>
<ComponentRef Id="cmp32DB946E4669A895FAC4826678D1CE7A"/>
<ComponentRef Id="cmpD17CBE22A3B94CCE9CF46B849289D40D"/>
</ComponentGroup>
<DirectoryRef Id="INSTALLLOCATION">
<Component Id="cmp98E16C7E23D449F3BC0ECF003543C3F9" Guid="*">
<File Id="fil153655C03E434A08A348DD833C6CE40A" KeyPath="yes" Source="$(var.FSClient.ProjectDir)\ReadMe.txt" />
</Component>
<Component Id="cmp32DB946E4669A895FAC4826678D1CE7A" Guid="*">
<File Id="filE4CB78ABCF2AE91B89FB0446A607E70C" KeyPath="yes" Source="$(var.FSClient.TargetDir)\WPFToolkit.dll" />
</Component>
......
......@@ -11,80 +11,102 @@
<?endif ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="f20f4348-01f9-457f-9112-60edb77761f4" Name="$(var.ProductName)" Language="1033" Version="1.0.0.0" Manufacturer="FreeSWITCH" UpgradeCode="7668faef-2ab3-4079-a986-07a33739b42e">
<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="1.0.1.0" Manufacturer="FreeSWITCH" UpgradeCode="7668FAEF-2AB3-4079-A986-07A33739B42E">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<PropertyRef Id="NETFRAMEWORK40CLIENT"/>
<Condition Message="This application requires .NET Framework 4.0 Client. Please run Setup">
<![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
</Condition>
<PropertyRef Id="NETFRAMEWORK40CLIENT"/>
<Condition Message="This application requires .NET Framework 4.0 Client. Please run Setup">
<![CDATA[Installed OR NETFRAMEWORK40CLIENT]]>
</Condition>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="INSTALLLOCATION" Name="FSClient">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent" Guid="594203af-235a-4a7d-aff8-045997f872ec"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
<Directory Id="MODLOCATION" Name="Mod">
</Directory>
<Directory Id="CONFLOCATION" Name="Conf">
</Directory>
<Directory Id="PLUGINLOCATION" Name="Plugins">
</Directory>
<Directory Id="MODLOCATION" Name="Mod">
</Directory>
<Directory Id="CONFLOCATION" Name="Conf">
</Directory>
<Directory Id="PLUGINLOCATION" Name="Plugins">
</Directory>
</Directory>
</Directory>
<?if $(var.Platform) != x64 ?>
<Merge Id="CrtFiles_x86"
SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC100_CRT_x86.msm"
DiskId="1"
Language="1033"/>
<?endif ?>
<?if $(var.Platform) = x64 ?>
<Merge Id="CrtFiles_x64"
SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC100_CRT_x64.msm"
DiskId="1"
Language="1033"/>
<?endif ?>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="FSClient"/>
</Directory>
<?if $(var.Platform) != x64 ?>
<Merge Id="CrtFiles_x86"
SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC100_CRT_x86.msm"
DiskId="1"
Language="1033"/>
<?endif ?>
<?if $(var.Platform) = x64 ?>
<Merge Id="CrtFiles_x64"
SourceFile="$(env.CommonProgramFiles)\Merge Modules\Microsoft_VC100_CRT_x64.msm"
DiskId="1"
Language="1033"/>
<?endif ?>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="FSClient"/>
</Directory>
</Directory>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="20BC8446-684B-44F5-A1E3-AF6010EAF37C">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="FSClient"
Description="FreeSWITCH Windows Phone"
Target="[INSTALLLOCATION]FSClient.exe"
WorkingDirectory="INSTALLLOCATION"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FSClient" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="20BC8446-684B-44F5-A1E3-AF6010EAF37C">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="FSClient"
Description="FreeSWITCH Windows Phone"
Target="[INSTALLLOCATION]FSClient.exe"
WorkingDirectory="INSTALLLOCATION"/>
<util:InternetShortcut Id="OnlineDocumentationShortcut"
Name="Online Documentation"
Target="http://wiki.freeswitch.com/wiki/FSClient"/>
<Shortcut Id="UninstallProduct"
Name="Uninstall FSClient"
Target="[SystemFolder]msiexec.exe"
Arguments="/x [ProductCode]"
Description="Uninstalls FSClient" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\FreeSWITCH\FSClient" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="ProductFeature" Title="FSClient Core" Level="1">
<!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. -->
<!-- <ComponentRef Id="ProductComponent" /> -->
<ComponentGroupRef Id="FSCoreComp"/>
<ComponentGroupRef Id="FSCoreModComp"/>
<ComponentRef Id="FSCoreConfComp"/>
<ComponentGroupRef Id="FSClientComp"/>
<ComponentRef Id="ApplicationShortcut" />
<!-- <ComponentRef Id="ProductComponent" /> -->
<ComponentGroupRef Id="FSCoreComp"/>
<ComponentGroupRef Id="FSCoreModComp"/>
<ComponentRef Id="FSCoreConfComp"/>
<ComponentGroupRef Id="FSClientComp"/>
<ComponentRef Id="ApplicationShortcut" />
<!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
<ComponentGroupRef Id="Product.Generated" />
<?if $(var.Platform) != x64 ?>
<MergeRef Id="CrtFiles_x86"/>
<?endif ?>
<?if $(var.Platform) = x64 ?>
<MergeRef Id="CrtFiles_x64"/>
<?endif ?>
<?if $(var.Platform) != x64 ?>
<MergeRef Id="CrtFiles_x86"/>
<?endif ?>
<?if $(var.Platform) = x64 ?>
<MergeRef Id="CrtFiles_x64"/>
<?endif ?>
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UIRef Id="WixUI_InstallDir" />
</Product>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
<UIRef Id="WixUI_InstallDir" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch FSClient" />
<Property Id="WixShellExecTarget" Value="[INSTALLLOCATION]FSClient.exe" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<WixVariable Id="WixUIBannerBmp" Value="Banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Dialog.bmp" />
<Icon Id="icon.ico" SourceFile="../phone.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." AllowSameVersionUpgrades="yes" />
</Product>
</Wix>
......@@ -85,6 +85,10 @@
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="Banner.bmp" />
<Content Include="Dialog.bmp" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论