我得到這個錯誤:威克斯複製文件錯誤
Unresolved reference to symbol 'Directory:SQLSERVERDATAPATH' in section 'Product:*
<Property Id="SQLSERVERINSTANCENAME" >
<RegistrySearch Id="SqlServerInstanceName" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Name="MSSQLSERVER" Type="raw"/>
</Property>
<Property Id="SQLSERVERDATAPATH" >
<RegistrySearch Id="SqlServerDataPath" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQLSERVERINSTANCENAME]\Setup" Name="SQLDataRoot" Type="raw"/>
</Property>
<DirectoryRef Id="SomeFolder">
<Component Id="MDFFileCopyComponent" Guid="4A002555-D939-4DC9-8C23-62747C2BA905">
<!--<RemoveFile Id="DatabaseFileRemove" Name="MyFile" On="install" Directory="MyCopyDir" />-->
<CopyFile Id="MDFFileCopy" FileId="MDF" DestinationDirectory="SQLSERVERDATAPATH" />
</Component>
<Component Id="LDFFileCopyComponent" Guid="4A002555-D939-4DC9-8C23-62747C2BA905">
<!--<RemoveFile Id="DatabaseFileRemove" Name="MyFile" On="install" Directory="MyCopyDir" />-->
<CopyFile Id="LDFFileCopy" FileId="LDF" DestinationDirectory="SQLSERVERDATAPATH" />
</Component>
</DirectoryRef>
更新:
<DirectoryRef Id="SomeFolder">
<Component Id="cmpMDF" Guid="066AFD32-D9B4-42A9-AEE1-F1951DAE959F">
<File Id="MDF" Name="Database.MDF" Source="DatabaseScripts/Database/Database.MDF" KeyPath="yes" ReadOnly="no">
<CopyFile Id="MDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
</File>
</Component>
<Component Id="cmpLDF" Guid="311283B0-A6E8-402D-BB33-D1BEB6EA282B">
<File Id="LDF" Name="Database.LDF" Source="DatabaseScripts/Database/Database.LDF" KeyPath="yes" ReadOnly="no">
<CopyFile Id="LDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
</File>
</Component>
</DirectoryRef>
登錄:
MSI(S)(18: BC)[13:42:32:002]:Ex導致:FileCopy(SourceName = Database.MDF,SourceCabKey = MDF,DestName = Database.MDF,Attributes = 512,FileSize = 1178468352,PerTick = 32768,VerifyMedia = 1 ,,,,, CheckCRC = 0 ,,, InstallMode = 58982400,HashOptions = 0,HashPart1 = -67171634,HashPart2 = 622189464,HashPart3 = -328220288,HashPart4 = -1777642375 ,,)
MSI(一個或多個)(18:BC)[13:42:32:006]:文件:C:\ Program Files \ MyApp \ Database \ Database.MDF;待安裝;不會修補;沒有現有文件
MSI(s)(18:BC)[13:42:32:009]:壓縮文件'MDF'的源文件。 \ MyApp \ Database \,大小:1178468352
MSI(s)(18:BC)[13:42:32:015]:注意:1:2318 2:C:\ Program Files \ MyApp \ Database \ Database .MDF
MSI(一個或多個)(18:BC)[13:42:32:034]:注:1:2360
我將其更改爲DestinationProperty,現在編譯它,但它不會將該文件複製到目標文件夾。 – gangt 2012-08-05 01:10:24
我更新了我的帖子。我在 元素內移動了,仍然一樣。 –
gangt
2012-08-05 02:05:46
安裝時創建日誌文件; 'msiexec/i「your.msi」/ l * v「C:\ temp \ install.log」',並檢查錯誤 – wimh 2012-08-05 06:58:19