解決安裝程式在win7/vista安裝時出現2869的錯誤

來源:互聯網
上載者:User

 

vs2005產生安裝程式時,想要加入一些動作,比如在安裝完成之後彈出一個視窗,或者在結束安裝後運行程式,這時需要使用CustomAction,具體操作參見
 Vs2005安裝程式完成後,自動啟動程式  http://blog.hjenglish.com/optop/articles/1208387.html 
 How can I customize an MSI in the Visual Studio setup/deployment project? http://blogs.msdn.com/astebner/archive/2006/08/12/696833.aspx

最後產生了一個msi檔案,在xp下面下使用這個msi檔案安裝程式一切都正常,但是在win7下時,會報錯誤2869,<The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869>
網上找了資料後,發現是 win7/vista的 UAC造成的,具體原因不再探究,下面是查到的解決方案,

Post-Build script to fix MSI issues in Vista for VS 2005 Setup and Deployment Projects
http://blog.csdn.net/sfz_roger/archive/2009/09/02/4508540.aspx

Solution for MSI Error 2869 on Windows Vista
http://blogs.x2line.com/al/archive/2007/07/20/3210.aspx

Windows installer error, Error Code : 2869. msidbCustomActionTypeNoImpersonate
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/c1326233-3f10-4d98-96a7-4a22e5eeaa2d/

都說需要向 CustomActions添加屬性 msidbCustomActionTypeNoImpersonate,不過我沒找到直接添加的方式,
後來用了第三個方案就可以了

需要注意的是, 那個需要儲存的代碼最好儲存到 msi產生的目錄下,然後cscript NoImpersonate.vbs <msi-file>放到安裝項目的 PostBuildEvent事件中

BTW:下面這篇文章講了下關於與UAC有關的內容,覺得還不錯
讓您的應用程式更好地適應 Windows Vista 的使用者帳戶控制
http://msdn.microsoft.com/zh-cn/magazine/cc163486.aspx

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.