TheProgramThe location of the set is different from the runtime location of the Assembly, especially in the Global Assembly Cache (GAC) Assembly, which needs to be handled when the winodws installer is created through Wix.
The position of the Assembly displayed in the Add reference window during vs design is from registry SOFTWARE \ Microsoft \. netframework \ assemblyfolders-put it under HKEY_LOCAL_MACHINE for all users, or put it under HKEY_CURRENT_USER for the current user.
To register a program to GAC, Wix only needs to add an option Assembly = ". net ", but the DLL registered to GAC will not be placed below the installation directory. This requires processing by providing two component methods, such as the following Configuration:
<? XML Version = "1.0" Encoding = "UTF-8" ? > < Wix Xmlns = "Http://schemas.microsoft.com/wix/2006/wi" > < Product ID = "A960cf35-0779-43e8-923b-35638f2bfc42" Name = "Minimal" Language = "2052" Version = "1.0.0.0" Manufacturer = "Geffzhang" Upgradecode = "0bf7e020-5bbd-4a06-8e39-e715999edbf5" > < Package Installerversion = "200" Compressed = "Yes" Description = "Minimal Windows Installer sample" Comments = "This installer database contains the logic and data required to install minimal Windows Installer sample ." /> < Media ID = "1" Cabinet = "Media1.cab" Embedcab = "Yes" /> < Property ID = "Enableev" Value = "1" > </ Property > < Condition Message = "You must have the Administrator permission to install the application" > <! [CDATA [privileged] > </ Condition > < Directory ID = "Targetdir" Name = "Sourcedir" > < Directory ID = "Programfilesfolder" > < Directory ID = "Installlocation" Name = "Minimal" > < Component ID = "Component1" Guid = "{1781a625-8acb-45e7-a8ba-219d81760b2e }" > < Createfolder /> < Environment ID = "Testminvar" Action = "Set" Part = "All" Name = "Minenvvar" Permanent = "No" System = "Yes" Value = "8" /> < File ID = "File_payload" Source = "Payload.txt" Keypath = "Yes" /> </ Component > < Directory ID = "GAC" Name = "GAC" > < Component ID = "Rtgactest" Guid = "22887611-b13e-41ee-897c-d78830e68aeb" Diskid = "1" > <! -- Runtime, assembly in GAC --> < File ID = "F_rt_gactest" Longname = "Gactest. dll" Source = ".. \ Build \ gactest. dll" Keypath = "Yes" Assembly = ". Net" /> </ Component > </ Directory > < Component ID = "Dtgactest" Guid = "FB935B7D-D2BD-4B83-A26C-A9376EBA0915" Diskid = "1" > <! -- Design-time, private assembly --> < File ID = "F_dt_gactest" Longname = "Gactest. dll" Source = ".. \ Build \ gactest. dll" Keypath = "Yes" /> < Registry ID = "R_dt_mycontrol_assemblyfolders" Root = "HKLM" Key = "SOFTWARE \ Microsoft \. netframework \ assemblyfolders \ [productname]" Value = "[$ Dtgactest]" Type = "String" /> </ Component > </ Directory > </ Directory > </ Directory > < Feature ID = "Productfeature" Title = "Minimal" Level = "1" > < Componentref ID = "Component1" /> < Componentref ID = "Dtgactest" /> < Componentref ID = "Rtgactest" /> </ Feature > < Property ID = "Wixui_installdir" Value = "Installlocation" /> < Uiref ID = "Wixui_installdir" /> < UI /> </ Product > </ Wix >
Gactest. DLL registers two component -- rtgactest and dtgactest. The file under rtgactest adds the attribute Assembly = ". net ", dtgactest is not added, and a registry project is added in dtgatest.