How to create a “standard” CDF programmatically?

How can I programmatically create a CDF which is similar to the CDFs created by File -> CDF Export -> Standalone...? Export supports CDFs but it does not use the same options as File -> Export... and it does not seem to allow setting the WindowSize which I also need.

My current solution is the following (ugly):

manip = Manipulate[Plot[k x, {x, 0, 10}], {k, 1, 5}, SaveDefinitions -> True]

Export["file.cdf",
doc = CreateDocument[manip,
ScrollingOptions -> {"VerticalScrollRange" -> Fit},
ShowCellBracket -> False,
Deployed -> True, CellContext -> Notebook,
TrackCellChangeTimes -> False]];

NotebookClose[doc]

-
Why not CDFDeploy["G:\\tmp\\test.cdf", manip, Method -> "Standalone"] – Rolf Mertig Jan 21 '13 at 23:06
@Rolf That is what I needed ... I never seriously worked with CDF before ... Actually this is not mentioned on the "How to create CDF" page, nor on the page describing the CDF export format. – Szabolcs Jan 21 '13 at 23:08
@Rolf If you post that as an answer, I'll adapt the question to it. Or do you think I should just delete it? – Szabolcs Jan 21 '13 at 23:09
The documentation is sufficiently strange that one does not immediately find CDFDeploy. So let's just keep it maybe. – Rolf Mertig Jan 21 '13 at 23:11

CDFDeploy["G:\\tmp\\test.cdf", manip, Method -> "Standalone"]

It also supports setting the WindowSize option.
Unfortunately this introduction to CDF does not mention CDFDeploy as a function. One has to arrive here to find this.