Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: gypify msi build #530

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,15 @@ def configure_winsdk(o):
print('ctrpp not found in WinSDK path--using pre-gen files '
'from tools/msvs/genfiles.')


def configure_wix(o):
if flavor != 'win':
return

o['variables']['wix_bin_dir'] = os.path.abspath(os.path.join(
os.environ.get('WIX'), 'bin'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If WIX is not there in the dictionary we will get NoneType doesn't have ... error. It's better to fail with KeyError in that case.



def write(filename, data):
filename = os.path.join(root_dir, filename)
print 'creating ', filename
Expand Down Expand Up @@ -949,6 +958,7 @@ configure_libuv(output)
configure_v8(output)
configure_openssl(output)
configure_winsdk(output)
configure_wix(output)
configure_intl(output)
configure_fullystatic(output)

Expand Down
100 changes: 99 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,104 @@
],
} ],
]
}
},

{
'target_name':'npm-files.wxs',
'type':'none',
'actions': [
{
'action_name':'heat',
'inputs': [
'deps/npm',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/npm-files.wxs',
],
'action': [
'"<(wix_bin_dir)/heat.exe"',
'dir', '<@(_inputs)',
'-out', '<@(_outputs)',
'-cg', 'NpmSourceFiles',
'-dr', 'NodeModulesFolder',
'-var', 'var.NpmSourceDir',
'-gg',
],
'msvs_quote_cmd': 0
},
],
},


{
'target_name':'installer',
'type':'none',
'dependencies': [ 'npm-files.wxs' ],

'conditions': [
['target_arch=="x64"', {
'variables': { 'program_files_folder_id': 'ProgramFiles64Folder' }
}, {
'variables': { 'program_files_folder_id': 'ProgramFilesFolder' }
}],
],
'sources': [
'tools/msvs/msi/product.wxs',
'<(SHARED_INTERMEDIATE_DIR)/npm-files.wxs'
],
'rules': [
{
'rule_name':'candle',
'extension':'wxs',
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).wixobj',
],
'action': [
'"<(wix_bin_dir)/candle.exe"',
'-dProductVersion=0.0.0.0',
'-dNoETW=0',
'-dNoPerfCtr=0',
'-dProgramFilesFolderId=<(program_files_folder_id)',
'-dNpmSourceDir=deps/npm',
'-dSourceDir=<(PRODUCT_DIR).',
'-dProjectDir=tools/msvs/msi/',
'-arch', '<(target_arch)',
'-ext', '<(wix_bin_dir)/WixUtilExtension.dll',
'-nologo',
'-out',
'<@(_outputs)',
'<(RULE_INPUT_PATH)',
],
},
],

}, {
'target_name': 'msi',
'type': 'none',
'dependencies': [ 'installer' ],
'actions': [
{
'action_name': 'light',
'inputs': [
'<(SHARED_INTERMEDIATE_DIR)/product.wixobj',
'<(SHARED_INTERMEDIATE_DIR)/npm-files.wixobj'
],
'outputs': [
'<(PRODUCT_DIR)/iojs-v-<(target_arch).msi'
],
'action': [
'"<(wix_bin_dir)/light.exe"',
'-cultures:en-US',
'-ext', '<(wix_bin_dir)/WixUIExtension.dll',
'-ext', '<(wix_bin_dir)/WixUtilExtension.dll',
'-loc', 'tools/msvs/msi/WixUI_en-us.wxl',
'<@(_inputs)',
'-out',
'<@(_outputs)'
]
}
]
},

] # end targets
}
2 changes: 0 additions & 2 deletions tools/msvs/msi/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<?define RegistryKeyPath = "SOFTWARE\io.js" ?>

<?define RepoDir="$(var.ProjectDir)..\..\..\" ?>
<?define SourceDir="$(var.RepoDir)\$(var.Configuration)\" ?>

<Product Id="*"
Name="$(var.ProductName)"
Expand Down Expand Up @@ -47,7 +46,6 @@
<ComponentRef Id="NodeVarsScript"/>
<ComponentRef Id="NodeStartMenuAndRegistryEntries"/>
<ComponentRef Id="AppData" />
<ComponentGroupRef Id="Product.Generated"/>

<Feature Id="NodeAlias"
Level="1"
Expand Down