def create_launcher(self, name, icon, command=None,
                        args=None, workdir=r'$EXEDIR\scripts',
                        launcher='launcher_basic.nsi'):
        assert name.endswith('.exe')
        portable_dir = osp.join(osp.dirname(osp.abspath(__file__)), 'portable')
        icon_fname = osp.join(portable_dir, 'icons', icon)
        assert osp.isfile(icon_fname)

        # Customizing NSIS script
        if command is None:
            if args is not None and '.pyw' in args:
                command = '${WINPYDIR}\pythonw.exe'
            else:
                command = '${WINPYDIR}\python.exe'
        if args is None:
            args = ''
        if workdir is None:
            workdir = ''

        fname = osp.join(self.winpydir, osp.splitext(name)[0]+'.nsi')

        data = [('WINPYDIR', '$EXEDIR\%s' % self.python_name),
                ('WINPYVER', self.winpyver),
                ('COMMAND', command),
                ('PARAMETERS', args),
                ('WORKDIR', workdir),
                ('Icon', icon_fname),
                ('OutFile', name)]

        build_nsis(launcher, fname, data)
Create exe launcher with NSIS
dataset/ETHPy150Open winpython/winpython/make.py/WinPythonDistribution.create_launcher