2012-01-31 96 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

回答