Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24157] Windows: CLI doesn't run ws-local app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-11-24T12:48:23.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.1, windowslib 0.4.24
ComponentsWindows
Labelsqe-6.0.1
ReporterKota Iguchi
AssigneeKota Iguchi
Created2016-11-18T01:18:15.000+0000
Updated2016-11-30T19:20:48.000+0000

Description

Titanium CLI freezes when you run Windows Store desktop app. It builds the app normally, but then it freezes when it tries to install the app while showing Press enter to continue….
appc ti build -p windows -T ws-local
Installing the application
Press enter to continue…

Attachments

FileDateSize
certmgr.png2016-11-18T15:04:19.000+000059329
TH4qc7w6A8h8209ODKl16g.png2016-11-18T01:21:36.000+000067412

Comments

  1. Kota Iguchi 2016-11-18

    maybe related: [keypress events not working in windows cmd.exe & powershell · Issue #5384 · nodejs/node](https://github.com/nodejs/node/issues/5384)
  2. Kota Iguchi 2016-11-18

    So it turns out that from at some version of Node.js spawn doesn't accept user input when you execute powershell script. Here's a sample code:
       var spawn = require('child_process').spawn,
           p = spawn('powershell', ['-NoLogo', '-File', 'Test.ps1']);
       
       p.stdout.on('data', function (data) {
         console.log('stdout: ' + data);
       });
       
       p.stderr.on('data', function (data) {
         console.log('stderr: ' + data);
       });
       
       p.on('close', function (code) {
         console.log('child process exited with code ' + code);
       });
       
    And here's the powershell script that shows prompt:
       Read-Host -Prompt 'Input something'
       
    node test.js should show the Input something: prompt, but it doesn't accept user input.
  3. Kota Iguchi 2016-11-18

    Tested using following versions of Node.js but none of them fixes the issue. * 4.4.7 * 4.6.2 * 5.5.0 * 6.3.1 * 6.9.1 * 7.1.0
  4. Ricardo Pereira 2016-11-18

    Have you tried to user 'run' instead of 'build'?
  5. Kota Iguchi 2016-11-18

    I tried "appc run" too but it doesn’t work well for me. I believe it's because “Press enter to continue…” won’t be shown when you already installed developer certificate. To see if you already installed developer certificate, launch “Manage user certificates” from control panel and navigate to “Trusted People > Certificates”. “CMake Test Cert” is the developer cert, and when you remove it, “Press enter to continue…” will be displayed for you again. Warning: I would not recommend deleting developer certificate unless you want to debug this issue because you'll be blocked as you can't launch your app due to this issue... :P !certmgr.png|thumbnail!
  6. Kota Iguchi 2016-11-22

    https://github.com/appcelerator/windowslib/pull/60
  7. Kota Iguchi 2016-11-22

    Note: This needs to be merged to titanium_mobile in order to close this ticket.
  8. Kota Iguchi 2016-11-25

    [~sliang], To apply this fix manually, replace C:\ProgramData\Titanium\mobilesdk\win32\YOUR_TI_SDK\node_modules\windowslib\lib\winstore.js with [this latest one](https://github.com/appcelerator/windowslib/blob/master/lib/winstore.js).
  9. Josh Longton 2016-11-30

    Verified as fixed the application now builds and runs successfully. Tested on: {noformat} Windows 10 Pro (1807) Ti SDK: 6.1.0.v20161130023500 Appc NPM: 4.2.8 App CLI: 6.0.0 Windowslib 0.4.20.1 Node v4.6,0 {noformat} Closing Ticket.

JSON Source