Create installer package with pdf license using productbuild - macos

I'm using productbuild command line tool on mac to create pkg installer. I need to provide an EULA in my package, so I've modified distribution.xml to include license:
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<license file="EULA.pdf" />
...
</installer-gui-script>
But it looks like pdf is not recognizeable by productbuild, license step shows pdf file content in plain text. I've tried to specify mime-type attribute, but the result is the same. After some googling, I've found that most people using either rtf or html license files.
Are supported file formats/UTI/MIME types documented somewhere? The only documentation I was able to find is https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html , but it doesn't say anything about supported formats.
More important question - can I somehow create an installer package with pdf license?

Related

Unable to step into Nuget package

I have a common project that I build and create a nuget package from, for consumption in my other applications.
The build process for the common project both creates a nuget package, deploys it to our private nuget repo and pushes the symbols to our internal symbol server.
In my "other applications", in this specific case an ASP.NET website, I pull in the nuget package from our repo but when I try to step into code in that assembly it just skips over it. I cleared my local symbol cache and as soon as I start debugging VS pulls in all the symbols from the symbol server so I know that bit is working.
Can anyone help me?
You need to publish Nuget package with symbols and refer to them using the Symbols under Tools->Options->Debugging->Symbols.
See HOW TO DEBUG A .NET CORE NUGET PACKAGE?
Other members also asked the similar issue before:
How to debug code in a nuget package created by me
Update:
Since you want to step into code in the assembly, you still need to provide the source code file in the NuGet package alongside the dll.
As we know:
A symbol is a file containing metadata that represent the link between
your original source code and the machine code that has been
translated by a compiler.
In the Microsoft world, a symbol is represented by a .PDB (Program DataBase) file. It is the heart of the debugging process because thanks to these metadata, the debugging tools are able to correlate the instructions executing in the application to the original source code and providing features like breakpoint or variable watchers.
So if you only provide the dll and .pdb file, you still not step into the code, you also need provide the source code, then add the source code to the Debug Source Files for the solution that references the package:
More detail on providing the source code:
If you're currently packaging without a Nuspec, you'll need to create a Nuspec, then add the pdb to the list of files in the lib folder and source file in the src folder. "NuGet spec" may be a useful command for generating the initial spec as defined in NuGet docs. Below is my .nuspec file, you can check it:
<?xml version="1.0"?>
<package >
<metadata>
<id>MyTestPackage</id>
<version>1.0.3</version>
<authors>Admin</authors>
<owners>Admin</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package description</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
<files>
<file src="bin\Debug\MyTestPackage.dll" target="lib\Net46" />
<file src="bin\Debug\MyTestPackage.pdb" target="lib\Net46" />
<file src="Class1.cs" target="src" />
</files>
</package>
More detail on add the source code to the Debug Source Files:
When you have a solution open, right click on Solution, select Properties...Common Properties...Debug Source Files, and add the root source directory for the relevant binary reference:

How to add an icon to a nuget package?

We are hosting our own nuget server through Teamcity. Is there any other way to add an icon to a .nuspec file other than specifying a web url (http://....)?
Or is there a place in Teamcity that these icons could be hosted?
As of NuGet 5.3.0 you can now use <icon> to provide a relative path to your JPEG or PNG icon file located within your package.
<package>
<metadata>
...
<icon>images\icon.png</icon>
...
</metadata>
<files>
...
<file src="..\icon.png" target="images\" />
...
</files>
</package>
Source: https://learn.microsoft.com/en-us/nuget/reference/nuspec#icon
<iconUrl> is now deprecated.
If you have your icon in a GitHub repository, you can locate it on GitHub.com, right click and "Copy image address". Then place this in your .nuspec. This worked for me:
<iconUrl>https://github.com/tcs1896/SharpChecker/blob/master/SharpChecker/SharpChecker/SharpChecker/Icon.png?raw=true</iconUrl>
No, this is the only option using the iconUrl property - See the NuSpec Reference
I would generally choose to host shared images like this on a CDN service rather than TeamCity - CloudFlare provide a free service.
The Documentation is as following
PackageIconUrl is deprecated in favor of the PackageIcon property Starting with NuGet 5.3 and Visual Studio 2019 version 16.3
So the way to do it is to add the following to your .csproj
<PropertyGroup>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="YOUR_PATH_TO_ICON\icon.png" Pack="true" PackagePath="\" />
</ItemGroup>
You can host icons on your TeamCity server, quoting Orn Kristjansson in TeamCity to serve static HTML page:
It's a Tomcat server, just go on your file system where you installed Teamcity and you should be able to find out where you can park some html that will then be available on the Teamcity urls.
So copy your icons into C:\...\TeamCity\webapps\ROOT\ and the will be served as static files.
I have a work around solution. I tried successfully on windows 10. It is useful if you have to install your application on the offline PC, without internet.
step 1:
add tag to the content of nuspec file. Something like the following:
<metadata>
<id>....</id>
...
<iconUrl>file://C:\app.ico</iconUrl>
...
<copyright>....</copyright>
</metadata>
step 2: generate the nupkg file from the above nuspec
step 3: generate the exe file from nupkg file
step 4:
put the app.ico file at location: C:\app.ico . You can choose any location according to <iconUrl> in the nuspec file. Almost windows PC have "C" drive disk. So that it is comfortable to install .exe in the other PC if you use "C" drive).
step 5: run exe file to install application on PC.
========= RESULT =============
At C:\Users\"user_name"\AppData\Local\"app_name" you can see the app.ico appears on the installed application folder.
I hope it may help you!
You can add file to nuspec content folder and specify link in such manner:
"file://content/images/icon.ico"
You can find more info here: Packages containing Icon and License

How to upload magento extension in Magento Connect?

I want to upload my own extension in Magento connect, but i am not able to upload zip file in Magento Connect. While uploading my module error is display " Unable to save version. Disallowed extension release file type. "
Any body have any idea, so please let me know.
Thanks in advance.
Your extension has to be of filetype extension .tgz as this is prescribed in Magento. There are online tools to convert .zip to .tgz like this site.
Also check this manual from Magento about how to package Magento Connect Extensions.
It seems the zip file you have is not a Magento package. You can use the Magento Connect Manager to upload only valid Magento packages containing a package.xml file in the correct format, including the <contents> element containing the extension files.
In the case you have a package.xml file having a structure like this one:
<?xml version="1.0"?>
<package>
<name>...</name>
<version>.</version>
...
<contents>...</contents>
...
</package>
try to recreate the package as a .tgz file by placing the package.xml in the root and the other files in their respective places relatively to the root.
In the case you do not have a package.xml file, I would advise you to consider installing the extension manually by coping its files to their respective places in your Magento installation.

JInstaller: :Install: Cannot find Joomla XML setup file

I create one template for joomla 2.5. But when I installed it it show the error:
"Failed loading XML file
D:\wamp\www\demoproject\tmp\install_51a44308e27b9\templateDetails.xml
XML: XML declaration allowed only at the start of the document
JInstaller: :Install: Cannot find Joomla XML setup file"
How can I solve it please?
It means your XML file isn't properly written. The actual error is:
XML declaration allowed only at the start of the document
Check the file and make sure
<?xml version="1.0" encoding="utf-8"?>
is the first line in the file. No line breaks or anything else is allowed before this.
That means you try to install the wrong .zip file. It happens often if you try to install a Joomla 1.5 template to a Joomla 1.6 website or the other way around.
Another common reason is, that you try to install the templates download package (<- the ZIP Archive with all the template stuff inside, like the psd file, the docs AND the installation files) , instead of the included installation file.
<extension version="2.5" type="template" client="site"> Try extension tag instead install.
<!DOCTYPE install PUBLIC "-//Joomla! 1.6//DTD template 1.0//EN" "http://www.joomla.org/xml/dtd/1.6/template-install.dtd"> Include the correct doc type.

How to create NuGet package that includes XML intellisense data

This link How do I create an XML Intellisense file for my DLL? explains how to build your dlls so that an XML file is included containing all your documentation headers so that they are available in those IntelliSense popups.
In my company we frequently distribute our own dlls using an internal NuGet package source. When I create NuGet packages for the package source, how do I ensure that someone else gets the dll from the package source, IntelliSense displays the documentation headers for them?
If you distribute your XML files with your NuGet package in the same folder as your Dlls then Visual Studio will then find these XML files and show IntelliSense for your assemblies.
To distribute the IntelliSense XML files you will need to add them to your .nuspec file, for example:
<files>
<file src="bin\IronPython.dll" target="lib\Net40" />
<file src="bin\IronPython.xml" target="lib\Net40" />
</files>
tl;dr documentation files need to be .xml not .XML
I was able to get the XML files included by first enabling the production using the Build tab, checking XML Documentation File in the Output section. Note: for some reason I had to manually change the extension from .XML to lowercase .xml. YMMV. This is the same as the question you referenced, How do I create an XML Intellisense file for my DLL?.
Once done, I created the Nuspec file in the project directory. Here's a sample, you can also generate it with nuget spec MyAssembly.dll - but make sure to edit it and set the values appropriately.
<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>1.0.0</version>
<title>Title for your package</title>
<authors>Package Author</authors>
<owners>Package Owner</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A description of your library</description>
<releaseNotes>Release notes for this version.</releaseNotes>
<copyright>Copyright 2013</copyright>
<tags>tag1 tag2</tags>
</metadata>
</package>
Once that was done, I used Nuget to package. Note I had to specify the platform because I'm using a 64-bit OS, but I don't have any targets in the project for x64, only AnyCPU
nuget pack MyAssembly.csproj -Prop Configuration=Release;Platform=AnyCPU -build
The assembly and it's associated documentation were automatically included in the package. In addition any packages that you've used in your project are added to the dependency list.
See http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package for more information.

Resources