C# CodedUI和安装程序不工作

C# CodedUI和安装程序不工作,c#,visual-studio,installation,coded-ui-tests,C#,Visual Studio,Installation,Coded Ui Tests,我使用CodedUI来录制产品的安装,并尝试在VisualStudio中重播该录制。我遇到了一些奇怪的问题,我不知道如何解决这些问题 Message: Test method CodedUITestProject5.CodedUITest1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: "T

我使用CodedUI来录制产品的安装,并尝试在VisualStudio中重播该录制。我遇到了一些奇怪的问题,我不知道如何解决这些问题

    Message: Test method CodedUITestProject5.CodedUITest1.CodedUITestMethod1 threw exception: 
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: "The application cannot be started because it cannot be found in the specified location, or the user does not have sufficient permissions to start the application." File: C:\Users\Sakamoto\AppData\Local\Temp\{CF4F5CDB-4597-4C70-BBFD-2687BB031067}\.cr\Setup.exe. Alternative file name: %TMP%\{CF4F5CDB-4597-4C70-BBFD-2687BB031067}\.cr\Setup.exe
有趣的是,安装文件位于我的桌面上,录音就是从那里开始的。查看UIMap.Designer.cs,它必须更正变量声明部分下记录的方法中列出的路径

我还以管理员身份运行Visual Studio 2017

更改UIMap.Designer.cs文件以使所有路径都指向桌面上的文件,会出现以下错误:

    Message: Test method CodedUITestProject5.CodedUITest1.CodedUITestMethod1 threw exception: 
Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToLaunchApplicationException: "The application cannot be started. This could be due to one of the following reasons:
1) Another instance of the application is already running and only one instance can be running at a time.
2) The application started another process and has now stopped. You may need to launch the process directly.
3) You do not have sufficient privileges for this application." File: C:\Users\Sakamoto\Desktop\Setup.exe.
有人能帮我自动运行安装过程吗