2012-01-31 88 views
0

我使用Inno Setup的创建我的应用程序,A 从第二个应用程序进行简单的设置,B,我要打电话到应用程序A的unins000.exe匹配unins000.exe如果不是000

所以我只是用这个代码,并完美的作品:

//get a new process to start 
ProcessStartInfo startInfo = new ProcessStartInfo(); 
    //get the basic exe file to run (the uninstall) 
startInfo.FileName = installPathA() + "\\unins000.exe"; 
    //start the uninstall 
Process p = new Process(); 
p.StartInfo = startInfo; 
p.Start(); 

但在这种情况下,我很难在它的unins000.exe编码为000

我想知道的是可以使它像unins...exe这样它会自动检查...上应该有哪些数字。

我以为第一次使用RegEx,但是这只能用在一个定义好的字符串上吗?或者我也可以用这种方式使用它吗? 还是有人知道更好的伎俩来做到这一点?

+2

你是什么意思的“自动检查”?有可能是unist123.exe或unins665.exe在文件夹中的unistallers和程序应该找到它?如果是这样,那么这应该找到它:startInfo.FileName = Directory.EnumerateFiles(installPathA(),@“unins * .exe”,SearchOption.TopDirectoryOnly).First(); – user1096188 2012-01-31 10:15:11

+0

是的,正是我在找的:)非常感谢你!太糟糕了,我不能将你的评论标记为:回答 – Dante1986 2012-01-31 10:20:36

回答