如何在 LabVIEW Installer 中包含和執行我的執行檔

更新 Aug 2, 2023

環境

軟體

  • LabVIEW 2014 Application Builder Module
  • LabVIEW 2014 Professional
  • LabVIEW Professional
  • LabVIEW Full
  • LabVIEW 2014 Full

我使用 Application Builder 生成了一個執行檔,現在我希望我的 LabVIEW Installer 在安裝程序完成後運行該執行檔。

要使LabVIEW Installer 在安裝程序完成後運行某執行檔,需要在創建 Installer 時做三項設定。

1.將執行檔添加到 Project 中:

a.在 Project 中找到 Project Explorer 視窗。
b.右鍵單擊 My Computer,然後單擊 Add File

2.瀏覽到您希望 Installer 完成後啟動的執行檔,然後單擊 Add File 按鈕。

執行檔會顯示在 Project Explorer 視窗中 My Computer 之下。

3.將執行檔加入 Installer 中:

a.在 Project Explorer 視窗中右鍵單擊 Build Specifications ,然後選擇 New » Installer
b.在左側的類別列表中選擇 Source Files。
c.在 Project View 中單擊加號來展開 My Computer
d.在展開的列表中單擊欲加入的執行檔,然後在 Destination View 中確認所選的目標位置是 project folder。
e.點擊 Project View 和 Destination View 之間的藍色箭頭,以將執行檔添加到目標資料夾。

在 Installer Properties 視窗中繼續:

1.設定 LabVIEW Installer 在安裝程序完成後運行該執行檔:

a.在左側的類別列表中選擇 Advanced。
b.找到 Advanced dialog window 的 Launch Executable After Installation。在LabVIEW 2009及更高版本中,勾選 Run Executable at End of Installer 框。
c.在執行檔路徑顯示的右側有兩個按鈕。左鍵點擊 Add Executable 按鈕。
d.從專案列表中選擇該執行檔,然後點擊 OK

現在,執行檔路徑將顯示在執行檔視窗中,並且已啟用 Command Line Arguments。如果有額外 Commands 要發送到執行檔,請在此填入。
如果不需要向執行檔發送額外命令,請單擊 Installer Properties 視窗底部的 OK 現在,Project Explorer 視窗將在Build Specifications 下方列出 Installer。

附加信息

警告:如果執行檔嘗試運行另一個NI Installer,則無法使用。內建的 Installer 將繼續運行,NI 軟體的安裝不能並行運行。要安裝NI軟體,請將其包含在 build specification 中的 Additional Installers 選項卡下。

對於 LabVIEW 5.0-7.1
1.通過單擊 Source Files tab 上的 Add Support File 按鈕,將執行檔添加為 Support File然後將文件放在Run Executable After Installation section。
2.勾選 Application Builder 的 Advanced tab 中的複選框(在LabVIEW 5.0及更早版本中,創建 Distribution Kit)。
a.要在 Installer 完成後執行多個執行檔,您將需要使用 batch file。請參見 How Can I Include Other Installers with the Installer for My LabVIEW Application? 知識庫文章。
3.請注意以下幾點:
a.該執行檔必須作為 build 的一部分,並由 main installer 進行安裝。它不能是單獨與 main installer 平行的。
b.在 Advanced tab 中,僅按名稱而不是按路徑指定執行檔的名稱。
c.執行檔名稱中每個字母的大小寫需一致。