如果D驅動器(D:\ MyApp)不存在,那麼我想將我的應用程序安裝到E驅動器(E:\ MyApp)中,如果D驅動器也不存在於目標計算機中,那麼我想安裝在C驅動器(C:\ MyApp的)。我應該在預處理器中使用哪個變量來檢查驅動器的存在?誰能幫我?如何檢查WIX中D和E驅動器的存在?
<?if E Drive exists ?>
<?define varRootDrive = "E:\" ?>
<?elseif D Drive exists ?>
<?define varRootDrive = "D:\" ?>
<?else ?>
<?define varRootDrive = "C:\" ?>
<?endif ?>
<?endif ?>
<Property Id="TARGETDIR"> $(var.varRootDrive) </Property>
網絡不好。 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/How-to-check-the-existence-of-D-and-E-drives-in-WIX-td7583102.html –