Using Solution Packager
Solution Packager is the best tool provided by customer to automate CRM Solution Build & Deploy. This tools comes with CRM Software Development Toolkit. This tool can reversibly decompose a Microsoft Dynamics 365 compressed solution file into multiple XML files and other files so that these files can be easily managed by a source control system. The following sections show you how to run the tool and how to use the tool with managed and un-managed solutions.
Prerequisites:
- CRM SDK – SolutionPackager.exe
- Visual Studio & Dynamics 365 application
Check the below links for more detailed information:
- Where to find Solution Packager.
- Use the /map command argument
- Managed and unmanaged solutions in context of solution packager
Watch the video to understand the practical way to do this posted by Marc Schweigert
NOTE : We can use Powershell to do this also.
Sample Commands:
solutionpackager.exe /action:Extract /zipfile:"D:\CRM\Sandbox\Default_1_0.zip" /folder:"Sandbox\Solution" solutionpackager.exe /action:Pack /folder:"D:\CRM\Sandbox" /zipfile:CRM_Solution.zip"
SolutionPackager command-line arguments
SolutionPackager is a command-line tool that can be invoked with the parameters identified in the following table.
Argument | Description |
---|---|
/action: {Extract|Pack} | Required. The action to perform. The action can be either to extract a solution .zip file to a folder, or to pack a folder into a .zip file. |
/zipfile: | Required. The path and name of a solution .zip file. When extracting, the file must exist and will be read from. When packing, the file is replaced. |
/folder: | Required. The path to a folder. When extracting, this folder is created and populated with component files. When packing, this folder must already exist and contain previously extracted component files. |
/packagetype: {Unmanaged|Managed|Both} | Optional. The type of package to process. The default value is Unmanaged. This argument may be omitted in most occasions because the package type can be read from inside the .zip file or component files. When extracting and Both is specified, managed and unmanaged solution .zip files must be present and are processed into a single folder. When packing and Both is specified, managed and unmanaged solution .zip files will be produced from one folder. For more information, see the section on working with managed and unmanaged solutions later in this topic. |
/allowWrite:{Yes|No} | Optional. The default value is Yes. This argument is used only during an extraction. When /allowWrite:No is specified, the tool performs all operations but is prevented from writing or deleting any files. The extract operation can be safely assessed without overwriting or deleting any existing files. |
/allowDelete:{Yes|No|Prompt} | Optional. The default value is Prompt. This argument is used only during an extraction. When /allowDelete:Yes is specified, any files present in the folder specified by the /folder parameter that are not expected are automatically deleted. When /allowDelete:No is specified, no deletes will occur. When /allowDelete:Prompt is specified, the user is prompted through the console to allow or deny all delete operations. Note that if /allowWrite:No is specified, no deletes will occur even if /allowDelete:Yes is also specified. |
/clobber | Optional. This argument is used only during an extraction. When /clobber is specified, files that have the read-only attribute set are overwritten or deleted. When not specified, files with the read-only attribute aren’t overwritten or deleted. |
/errorlevel: {Off|Error|Warning|Info|Verbose} | Optional. The default value is Info. This argument indicates the level of logging information to output. |
/map: | Optional. The path and name of an .xml file containing file mapping directives. When used during an extraction, files typically read from inside the folder specified by the /folder parameter are read from alternate locations as specified in the mapping file. During a pack operation, files that match the directives aren’t written. |
/nologo | Optional. Suppress the banner at runtime. |
/log: | Optional. A path and name to a log file. If the file already exists, new logging information is appended to the file. |
@ | Optional. A path and name to a file that contains command-line arguments for the tool. |
/sourceLoc: | Optional. This argument generates a template resource file, and is valid only on extract.
Possible values are auto or an LCID/ISO code for the language you want to export. When this argument is used, the string resources from the given locale are extracted as a neutral .resx file. If auto or just the long or short form of the switch is specified, the base locale or the solution is used. You can use the short form of the command: /src. |
/localize | Optional. Extract or merge all string resources into .resx files. You can use the short form of the command: /loc. |
Thanks for watching the video and article hope this helped you.