usercore: remove code duplication in desktop file creation

no functional change