Powershell脚本不构建WiX安装程序

时间:2016-09-14 13:02:36

标签: powershell msbuild wix nant

我已经获得了构建3个不同安装程序的PowerShell脚本。 其中两个是成功构建的,但第三个没有。脚本创建&bin; /释放'文件夹(如果不存在)但缺少thrd安装程序的.msi文件。 正如您在下面的日志中看到的那样,没有错误,编译器打印出消息BUILD SUCCEEDED

CreateNCPluginInstaller:

 [nant] C:\..\build\NantBuilds\CreateNCPluginInstaller.build 
        Buildfile: file:///C:/../build/NantBuilds/CreateNCPluginInstaller.build
        Target framework: Microsoft .NET Framework 4.6.1
        Base Directory: C:\_..\.
        Target(s) specified: createInstallerForNCPlugin 

        Build sequence for target `createInstallerForNCPlugin' is createInstallerForNCPlugin
        Complete build sequence is createInstallerForNCPlugin

        createInstallerForNCPlugin:

             [echo] Create N C Plugin Installer
            [sleep] Sleeping for 2000 milliseconds.
             [exec] Starting 'powershell ("C:\..\build\CreateInstallerForNCPlugin.ps1 Release")' in 'C:\..\'
             [exec] --> 09/14/2016 14:48:34
             [exec] --> Start compiling project
             [exec] --> 09/14/2016 14:48:34
             [exec] --> C:\..\scr\Installers\Plugins\E.N.C.Setup\E.N.C.Setup.wixproj
             [exec] --> 09/14/2016 14:48:34
             [exec] --> C:\..\E.sln
             [exec] True
             [exec] --> 09/14/2016 14:48:43
             [exec] --> End compiling project
             [exec] --> 09/14/2016 14:48:43
             [exec] --> Start copying outputs project
             [exec] --> 09/14/2016 14:48:43
             [exec] --> Copying files from C:\..\scr\Installers\Plugins\E.N.C.Setup\bin\Release\* to C:\_..\installers
             [exec] --> 09/14/2016 14:48:43
             [exec] --> End copying outputs project

        BUILD SUCCEEDED

        Total time: 11.8 seconds.

其他2个安装程序的输出完全相同。

脚本按顺序运行(我也使用NAnt):

<project name="E" default="createNCPluginInstaller" basedir="..\..\">
<description>Create N C Plugin Installer Build Configuration</description>

<target name="createNCPluginInstaller" description="Creates N C Installer">
<echo message="Create N C Plugin Installer" />
<sleep milliseconds="2000" />
    <exec program="powershell" verbose="true" failonerror="true">
        <arg value="${src}build\CreateInstallerForNCPlugin.ps1 ${build-configuration}"/>
    </exec>
</target>   

ExecuteInstaller $eSolution $eNWebSetupProject 'E.N.C.Setup' 'wixproj' $buildConfiguration $outputDirectory

function ExecuteInstaller([string] $solutionPath, [String] $projectPath, 
     [String] $projectName, [String] $projectType, [String] $buildOption, [string] $outputDirectory)
{

PrintToOutputMessage "Start compiling project"

    $project = $projectPath + '\' + $projectName + '.' + $projectType

    PrintToOutputMessage $project

    PrintToOutputMessage $solutionPath

    $ps = new-object System.Diagnostics.Process
    $ps.StartInfo.Filename = $devenvPath
    $ps.StartInfo.Arguments = " ""$solutionPath"" /Build ""$buildOption"" /project ""$project"" "
    $ps.StartInfo.RedirectStandardOutput = $True
    $ps.StartInfo.UseShellExecute = $false
    $ps.start()
    $ps.WaitForExit()
    [string] $Out = $ps.StandardOutput.ReadToEnd();

    $from = $projectPath + '\bin\' + $buildOption + '\*'

    PrintToOutputMessage "End compiling project"

    PrintToOutputMessage "Start copying outputs project"

    CopyItemsWithSameExtensions $from $outputDirectory "*.msi"

    PrintToOutputMessage "End copying outputs project"
}

我检查了脚本生成的所有路径是否正确,以及每个项目的构建设置。

我不知道会发生什么,我仍然可以检查,任何建议将不胜感激。如果被问到,我可以提供更多细节。

由于

0 个答案:

没有答案