< prev index next >

modules/jdk.packager/src/main/native/javapackager/win/javapackager.cpp

Print this page


   1 /*
   2  * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 547             fwprintf(stdout, TEXT("Executable File Name: %s\n"), argv[i + 2]);
 548 
 549             VersionInfoSwap vs(argv[i + 1], argv[i + 2]);
 550 
 551             if (vs.PatchExecutable()) {
 552                 return 0;
 553             }
 554             else {
 555                 fwprintf(stderr, TEXT("failed\n"));
 556                 return 1;
 557             }
 558         }
 559         else {
 560             args = args + L" \"" + argv[i] + L"\"";
 561         }
 562     }
 563 
 564 
 565     cmd += debug +
 566         L" " + memory +
 567         L" -Djavafx.home=" + javafxhome +
 568         L" -classpath " + fxlib + L"ant-javafx.jar" +
 569         L" com.sun.javafx.tools.packager.Main" +
 570         L" " + args;
 571 
 572 #ifdef _DEBUG
 573     printf ("%s", cmd.c_str());
 574 #endif
 575 
 576     STARTUPINFO start;
 577     PROCESS_INFORMATION pi;
 578     memset(&start, 0, sizeof (start));
 579     start.cb = sizeof(start);
 580 
 581     if (!CreateProcess(NULL, (wchar_t *) cmd.data(),
 582             NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &start, &pi)) {
 583 #ifdef _DEBUG
 584         fprintf(stderr, "Cannot start java.exe");
 585 #endif
 586         return EXIT_FAILURE;
 587     }
 588 
   1 /*
   2  * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 547             fwprintf(stdout, TEXT("Executable File Name: %s\n"), argv[i + 2]);
 548 
 549             VersionInfoSwap vs(argv[i + 1], argv[i + 2]);
 550 
 551             if (vs.PatchExecutable()) {
 552                 return 0;
 553             }
 554             else {
 555                 fwprintf(stderr, TEXT("failed\n"));
 556                 return 1;
 557             }
 558         }
 559         else {
 560             args = args + L" \"" + argv[i] + L"\"";
 561         }
 562     }
 563 
 564 
 565     cmd += debug +
 566         L" " + memory +
 567         L" -Djavafx.home=\"" + javafxhome +
 568         L"\" -classpath \"" + fxlib + L"\"ant-javafx.jar" +
 569         L" com.sun.javafx.tools.packager.Main" +
 570         L" " + args;
 571 
 572 #ifdef _DEBUG
 573     printf ("%s", cmd.c_str());
 574 #endif
 575 
 576     STARTUPINFO start;
 577     PROCESS_INFORMATION pi;
 578     memset(&start, 0, sizeof (start));
 579     start.cb = sizeof(start);
 580 
 581     if (!CreateProcess(NULL, (wchar_t *) cmd.data(),
 582             NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &start, &pi)) {
 583 #ifdef _DEBUG
 584         fprintf(stderr, "Cannot start java.exe");
 585 #endif
 586         return EXIT_FAILURE;
 587     }
 588 
< prev index next >