使用Visual Studio安裝項目。我想將每個人/只是我的選擇更改爲在以前的安裝過程中選擇的用戶。如何根據以前安裝的版本選擇Everyone/Just Me?
1
A
回答
2
終於明白了。使用VBScript自定義操作。
Dim myUpgradeCode
myUpgradeCode = "{6EFB1553-7F4F-4E26-A32B-E2F0F8E11CA9}"
Dim justMe
justMe = False
'AssignmentType
' Equals 0 if product is advertised or installed per-user.
' Equals 1 if product is advertised or installed per-machine for all users.
Set products = Session.Installer.RelatedProducts(myUpgradeCode)
For Each product In products
astp = CLng(Session.Installer.ProductInfo(product, "AssignmentType"))
If astp = 0 Then
justMe = True
End If
Next
If JustMe Then
Session.Property("ALLUSERS") = ""
Else
Session.Property("ALLUSERS") = "1"
End If
並在AppSearch之前執行它。
完成!
0
在安裝過程中,您可以將ALLUSERS
MSI屬性的值保存到註冊表中的明確位置。然後,您可以在升級並相應採取行動時查詢該值。
您也可以使用MSI API來檢查您的產品是按照每臺機器還是每個用戶的環境安裝的。爲此,您可以調用MsiEnumProductsEx
函數,並查看您的產品是否出現在任一安裝上下文中。
相關問題
- 1. 如何安裝以前版本的Node.js?
- 2. mxnet安裝:如何選擇python版本?
- 3. Wix安裝程序有選擇地卸載以前的版本
- 4. 以前的php版本pecl安裝
- 5. 安裝以前版本的MonoTouch
- 6. 安裝以前版本的GPE?
- 7. 如何選擇數據庫元素的以前版本?
- 8. 檢查以前安裝的版本的Mac安裝程序?
- 9. Wix 3.8:安裝程序不卸載以前的版本或安裝新版本
- 10. jqGrid的填充根據以前選擇
- 11. 如何根據以前的選擇篩選下拉列表
- 12. 如何根據以前的選擇禁用選項?
- 13. 如何使用NuGet安裝一次5.0.0.0的EntityFramework版本4.4.0.0以前的版本
- 14. xpath - 我如何根據前面的文本選擇複選框
- 15. 如何安裝以前的Android支持庫(版本8)
- 16. Visual Studio:如何自動卸載以前安裝的版本?
- 17. 如何在安裝新版本時刪除以前版本的應用程序
- 18. 如何選擇安裝2個版本時使用的默認Subversion(svn)版本
- 19. 根據以前的選擇篩選三個選擇框
- 20. 根據以前的選擇顯示選擇選項
- 21. 如何根據版本號選擇最新的記錄?
- 22. 如何根據以前選擇的JButton更改JPanel的內容?
- 23. 如何根據以前參數的選擇爲SSRS中的參數選擇值?
- 24. 如何根據以前的選擇過濾掉下拉列表
- 25. 根據以前的選擇填充選擇框
- 26. 根據以前的選擇使用Javascript選擇框
- 27. 如何可以根據IOS版本
- 28. 如何根據用戶選擇調用子版本?
- 29. Inno Setup ...如果安裝了以前的版本,則使用舊的數據庫
- 30. NSIS默認安裝目錄 - 要根據安裝選項進行選擇
好吧..得到它在Custom Action VBScript中工作。但即使我將ALLUSERS設置爲「{}」,也會爲所有用戶安裝。爲什麼? 自定義操作在「LaunchConditions」之前執行。它會將ALLUSERS設置爲「{}」或「1」。 – Trainee4Life 2010-08-05 14:32:59