打包時加入卸載功能

來源:互聯網
上載者:User
方法一:
1.在打包項目中添加檔案msiexec.exe(一般可在c:/windows/system32/下找到)
2.在檔案系統視圖中選擇應用程式檔案夾,在msiexec.exe上按右鍵,選擇創建捷徑,重新命名捷徑為"卸載".
3.更改此捷徑的Arguments 為"/x {產品id}",產品id的值為打包項目的ProductCode屬性值.
方法二:(推薦)
1.先產生安裝包,記下ProductCode(選擇方案總管根目錄如setup1,再查看屬性標籤,不是右鍵中的屬性),下面要用到
2.用VS.net建立一個新的控制台程式uninst.exe檔案
'power by: landlordh
'for 2000,xp,2003
Module uninstall
    Sub Main()
        Dim myProcess As Process = New Process
        If System.Environment.OSVersion.ToString.IndexOf("NT 5") Then
            myProcess.Start("msiexec", "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}")  '改為自己的ProductCode
        End If
        myProcess.Close()
    End Sub
End Module
3.將控制台程式BIN目錄的exe檔案加入到打包程式檔案中,在程式組建立uninst.exe的捷徑
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.