From SmallBysiness I restored BarcodePrintingComponents for linux 32, 64, Win 32, 64 and then loaded to commontemplates.
When the form is opened, according to clients platformtype I save the binarydata to tempstorage.
And when I want to install the externalcomponent that saved to tempstorage, I recieve an error. Eroor message is, "External component was not installed! Error in installation process!"
Example code is here:
Code
ConnectionCompleted = Undefined;
ConnectionCompleted = DışBileşenAttach();
If Not ConnectionCompleted Then
If DışBileşenYükle(SystemInfo) Then
ConnectionCompleted = DışBileşenAttach();
EndIf;
EndIf;
// Create object of external component
If ConnectionCompleted Then
ExternalComponent = New("AddIn.BarCodePicture.Barcode");
Else
Return Undefined;
EndIf;
&AtClient
Function DışBileşenAttach(SystemInfo)
ConnectionCompleted = AttachAddIn(ExComponentAdress, "BarCodePicture", AddInType.Native);
Return ConnectionCompleted;
EndFunction // DışBileşenYükle()
&AtClient
Function DışBileşenYükle()
SuccessFull = False;
Try
InstallAddIn(ExComponentAdress);
SuccessFull = True;
Except
EndTry;
Return SuccessFull;
EndFunction // DışBileşenYükle()
If Sistem = "Win32" Then
Değer = GetCommonTemplate("BarcodePrintingComponentWindows32_idr");
ElsIf Sistem = "Win64" Then
Değer = GetCommonTemplate("BarcodePrintingComponentWindows64_idr");
ElsIf Sistem = "Lin32" Then
Değer = GetCommonTemplate("BarcodePrintingComponentLinux32_idr");
ElsIf Sistem = "Lin64" Then
Değer = GetCommonTemplate("BarcodePrintingComponentLinux64_idr");
EndIf;
Adres = PutToTempStorage(Değer, New UUID);
&AtClient
Function AttachAddInOfBarcodePrinting() Export
// Depending on platform type connect required external component
ConnectionCompleted = Undefined;
ConnectionCompleted = DışBileşenAttach();
If Not ConnectionCompleted Then
If DışBileşenYükle() Then
ConnectionCompleted = DışBileşenAttach();
EndIf;
EndIf;
// Create object of external component
If ConnectionCompleted Then
ExternalComponent = New("AddIn.BarCodePicture.Barcode");
Else
Return Undefined;
EndIf;
// If there is no option to draw
If NOT ExternalComponent.GraphicsPresent Then
// Can't generate picture
Return Undefined;
Else
// Setup component main parameters
// If Tahoma font is installed in the system
If ExternalComponent.FindFont("Tahoma") = True Then
// Choose it as font for picture
ExternalComponent.Font = "Tahoma";
Else
// No Tahoma font in the system
// Loop over all fonts available for component
For Acc = 0 To ExternalComponent.NumberOfFonts -1 Do
// Get next font, available for component
CurrentFont = ExternalComponent.FontAt(Acc);
// If font is available
If CurrentFont <> Undefined Then
// It'll be the font for generating bar-code
ExternalComponent.Font = CurrentFont;
Break;
EndIf;
EndDo;
EndIf;
// Set font size
ExternalComponent.FontSize = 12;
Return ExternalComponent;
EndIf;
EndFunction
&AtClient
Function DışBileşenAttach()
Sys = New SystemInfo;
If Sys.PlatformType = PlatformType.Windows_x86 Then
TemplateName = "BarcodePrintingComponentWindows32_idr";
ElsIf Sys.PlatformType = PlatformType.Windows_x86_64 Then
TemplateName = "BarcodePrintingComponentWindows64_idr";
ElsIf Sys.PlatformType = PlatformType.Linux_x86 Then
TemplateName = "BarcodePrintingComponentLinux32_idr";
Else
TemplateName = "BarcodePrintingComponentLinux64_idr";
EndIf;
ConnectionCompleted = AttachAddIn("CommonTemplate."+TemplateName, "BarCodePicture", AddInType.Native);
Return ConnectionCompleted;
EndFunction // DışBileşenYükle()
&AtClient
Function DışBileşenYükle()
SuccessFull = False;
Sys = New SystemInfo;
If Sys.PlatformType = PlatformType.Windows_x86 Then
TemplateName = "BarcodePrintingComponentWindows32_idr";
ElsIf Sys.PlatformType = PlatformType.Windows_x86_64 Then
TemplateName = "BarcodePrintingComponentWindows64_idr";
ElsIf Sys.PlatformType = PlatformType.Linux_x86 Then
TemplateName = "BarcodePrintingComponentLinux32_idr";
Else
TemplateName = "BarcodePrintingComponentLinux64_idr";
EndIf;
Try
InstallAddIn("CommonTemplate."+TemplateName);
SuccessFull = True;
Except
EndTry;
Return SuccessFull;
EndFunction // DışBileşenYükle()
Is there any working example where system configuration is thus: Server Config - Ununtu 12.10 (64-bit). PostgreSQL_9_2_1_1_1C_x86_64 1C:Enterprise 8.2.17.157 Client Config - Web Browsers in Linux OS and Windows OS
Sergey, in this forum attachment doesn't exceed more than 1 Mb. the attachment is 4-5 Mb. I will copy those binarydatas to ftp and will send you acception from private
I test your code on another BarcodePrintingComponents - it works I send example to your mail I think that you restored wrong component, or component was saved in wrong format