Tôi đang cố gắng triển khai phiên bản tự động để khi tôi xây dựng Bootstrapper, cả phiên bản MyApp và Bootstrapper đều được tự động tăng và đồng bộ. Nếu không, bạn kết thúc với các mục khởi động trùng lặp trong các chương trình thêm/xóa cho mỗi lần cài đặt với các phiên bản phù hợp.Tự động tăng và đồng bộ hóa phiên bản cho sản phẩm và bootstrapper
Khi tôi xây dựng bootstrapper, mục tiêu AfterBuild sử dụng GetAssemblyIdentity
để lấy phiên bản MyApp được tạo tự động thành công và tệp đầu ra bootstrapper được đặt tên đúng với số phiên bản tăng lên, ví dụ: MyApp.1.0.5123.1352.exe
Tuy nhiên, khi tôi cài đặt Bootstrapper này, phiên bản hiển thị trong chương trình thêm/xóa luôn là 1.0.0.0
.
Tôi đã thử sử dụng các liên kết trong trường Phiên bản gói Bootstrapper nhưng tôi không thể đọc nó để đọc phiên bản MyApp.
Sử dụng !(bind.packageVersion.MyApp)
kết quả không bao giờ tăng lên 1.0.0.0.
Sử dụng !(bind.assemblyName.MyApp)
kết quả trong các lỗi xây dựng (Biến thời gian ràng buộc chưa được giải quyết).
Sử dụng !(bind.FileVersion.filAAF013CA9B89B07C81031AE69884BF11)
kết quả trong các lỗi xây dựng (Biến thời gian ràng buộc chưa được giải quyết). < - Có ý nghĩa như FileID tồn tại trong dự án Setup
và đây là dự án Bootstrapper
.
What can I do to get my Bootstrapper Bundle to have the same version as the MyApp it is packaging?
===== MyApp \ AssemblyInfo.cs =====
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("1.0.*")]
===== ===== Setup.wixproj
<Target Name="BeforeBuild">
<PropertyGroup>
<LinkerBaseInputPaths>..\MyApp\bin\$(Configuration)\</LinkerBaseInputPaths>
</PropertyGroup>
<HeatDirectory OutputFile="MyApp_Files.wxs" Directory="..\MyApp\bin\$(Configuration)\" DirectoryRefId="INSTALLLOCATION" ComponentGroupName="MyApp_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" />
</Target>
= ==== Bootstrapper.wixproj =====
<Target Name="AfterBuild">
<GetAssemblyIdentity AssemblyFiles="..\MyApp\bin\$(Configuration)\MyApp.exe">
<Output TaskParameter="Assemblies" ItemName="AssemblyVersion" />
</GetAssemblyIdentity>
<Copy SourceFiles=".\bin\$(Configuration)\$(OutputName).exe" DestinationFiles=".\bin\$(Configuration)\MyApp.%(AssemblyVersion.Version).exe" />
<Delete Files=".\bin\$(Configuration)\$(OutputName).exe" />
</Target>
===== Bootstrapper \ Bundle.wxs =====
<Bundle Name="$(var.ProductName) Bootstrapper v!(bind.packageVersion.MyApp)"
Version="!(bind.packageVersion.MyApp)"
bind.packageVersion. chỉ có thể đọc phiên bản từ một dự án thiết lập vì vậy tôi mong đợi rằng sẽ được bind.packageVersion.Setup. – Neil