Video Screencast Help

{CWoC: Experimental} Create SolutionSam Mirror, a Tool to Centralise SMP Installation?

Created: 24 Feb 2011 • Updated: 24 Feb 2011 | 3 comments
Ludovic Ferre's picture
+3 3 Votes
Login to vote

Create SolutionSam Mirror (csm) documentation

Document map:


This tool is currently in its early phases and may still have a few issues around performance or optimizations (specially around file copy and verifications).

Command line options:

create-solnsam-mirror (create SolutionSam mirror, csm in short) is a tool to locally mirror the SolutionSam directory structure as documented in the product listing file. It should be used inside the Symantec Installation Manager folder or on a mirror.

Mandatory arguments:
	-f, --file-name <file> pointing to the to use
Command line options are:
	-c, --copy-file to copy files from the running directory onto their
			SolutionSam directory.
	-h, --help, /? to show this help message
	-V, --version to output program version only
	-l, --log-level <lvl>	Output log data <= to <lvl> to stderr:
		--log-level  1 -> error
		--log-level  2 -> warning
		--log-level  4 -> information
		--log-level  8 -> verbose
		--log-level 16 -> debug

Build flavours:

This tool is written in plain C on Linux, so it uses POSIX interfaces and the C built-in functions to run on Linux and Windows. The build flavours are:

  • 32-bit Windows (code = ia32.exe)
  • 64-bit Windows code = amd64.exe)
  • 32-bit Linux (code = ia32)
  • 64-bit Linux (code = amd64)

And the desired load modules (built files) names are thus crafted using this template:


What the tool does:

The tool parse the product listing xml files provide via the '--file-name <pl_xml_filename>' command line argument. It reads the content of the file and extract package information anytime a package is found. The extracted information contains 4 elements:

  • File name (file_name)
  • Download url (full_url)
  • File size (file_size)
  • File SHA265 hash (file_hash)

These elements are used to create a local path starting at the running directory, which is then the mirror root directory, and is written to a text file under the mirror directory as <file_name>_info.

If the copy file argument is provided ('--copy-file' or '-c') csm will check if a file matching the package file_name and file_size attribute exist and then create a copy of it under the computed mirror directory. If the file already exists the copy will be skipped (to avoid copying the whole root directory content upon minor updates for example).

What the tool doesn't do:

The IIS directory is not created, but this is a minor task, described here:

  • Run Inetmgr
  • Create a new Virtual directory pointing to your 'Symantec Installation Manager\Installs\Altiris' folder
  • Change the security (allow directory browsing, add authentication if needed etc).

The file is not copied (this may be added in the todo list) to solutions/pl, so you need to:

  • Create a directory named pl under 'solutions' on the SIM 'Installs\Altiris' path
  • Copy the file to solutions\pl
  • Copy the file to solutions\pl

On the client SIM (the server without Internet access) you need to make sure the server can access your local SolutionSam mirror. To do this just edit the hosts file as detailed here

Source code

See the attached zip file

TODO list

  • [Undecided] Implement a sha256 hash function to verify the installation files
  • [Confirmed] Create the pl folder and copy the xml file
  • [Undecided] Manage the multiple xml file versions

Comments 3 CommentsJump to latest comment

RobertLundsten's picture

Very nice tool Ludovic!

Keep up the good work.

Login to vote
Pascal KOTTE's picture

But I was thinking you were able to run SIM on any machine, and build a "offline" installation package using it ? Don't this tool a duplicate this feature "package build" ?

~Pascal @ Do you speak French? Et utilisez Altiris: venez nous rejoindre sur le GUASF

Login to vote
Ludovic Ferre's picture

I can't remember the exact reasons why I started this but it looked like an easy target, and a minor extension to the clean_pl_xml tool I already wrote [1].

There are a couple of use case were this "proof of concept" is a winner compare to using the package builder:

  1. You need multiple servers that don't have internet access and different solutions
  2. You needn't recreate the package to include forthcoming updates
  3. You should be able to add the pmimport in the tree structure there too

But it's not a competing product ;).

I learnt a few interesting things coding this: I now set signal handlers in most of my codes, I started working with files (using POSIX and C library functions) and I also learnt to work with directories etc.

Funnily enough coding in C may look pointless in times where python, java, .net nad other garbage collected languages exist but it's really insight full when it comes to thinking in term of process, memory space, libraries and all that makes an executable file run (in real life).


Ludovic FERRÉ
Principal Remote Product Specialist

Login to vote