Creating an EXE from Python Script, how to bundle other exes - selenium-webdriver

I am creating an EXE file from a python script using pyinstaller and I need to include the Selenium Chrome and IE executables with this exe. How can I bundle those so when someone installs my exe it also includes both of those?

Related

How to refer to a different directory to cmake while running cmake commands from a batch script on Windows

I come from a Linux Unix background and I am trying to covert a very simple .sh to a .bat script.
I want to run a cmake command in a batch file on Windows 10. But I want to run the cmake command from inside of a build directory placed outside the source code directory. The source code directory is just along side the build folder.
::build_something.bat
mkdir build
CD build
cmake ../SourceCodeDir
As you can see above that I want to generate all the build files inside the build/ directory.
But the issue is cmake instead wrongly tries to find the SourceCodeDir directory inside build/ complaining that build/SourceCodeDir does not exist. This indicates that I am doing the directory navigation wrong in the batch script. How should I modify the Unix based folder navigation to a Windows based folder navigation on the batch script?
Following is the exact error that cmake states:
CMake Error: The source directory "C:/code/build/SourceCodeDir" does not exist.
PS:
I am running the batch script from a git bash shell.
I understand that the slashes in directory paths are Linux based but that should not be an issue since I am running it from git bash? Or is that one of the problems in the bat script?

.NET 5 excludes some libraries from single file publication

I have a little problem with single file executable publish with .NET 5.
Infact, it does not include all libraries in the executable file, and produces multiple files.
In my example I'm using a library for SQLite (Microsoft.Data.Sqlite) and, after compilation, e_sqlite3.dll is not included.
Instead, in the output folder, it produces two files (excluding the pdb file):
> e_sqlite3.dll
> WpfApp1.exe
By reading documentation
Single-file doesn't bundle native libraries by default. On Linux, we prelink the runtime into the bundle and only application native libraries are deployed to the same directory as the single-file app. On Windows, we prelink only the hosting code and both the runtime and application native libraries are deployed to the same directory as the single-file app. This is to ensure a good debugging experience, which requires native files to be excluded from the single file. There is an option to set a flag, IncludeNativeLibrariesForSelfExtract, to include native libraries in the single file bundle, but these files will be extracted to a temporary directory in the client machine when the single file application is run.
So (in my case e_sqlite3.dll) native libraries are not included by default to ensure a good debugging experience.
If you want to include them anyway in the application executable, you can simply add this line to the project (.csproj) file.
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
Example:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<StartupObject>WpfApp1.App</StartupObject>
<Description>WpfApp1</Description>
</PropertyGroup>
...
</Project>

Exe created by Exe4j with external libs dependation

We are trying to wrap our jar file with exe4j to exe file. Our jar depends on several jar libraries stored in libs folder.
We don't want to distribute jar file, only exe and jar libraries in libs folder.
For execution of application we are using own JRE.
Here is the file structure of application:
/java
/libs
application.exe
In the project type, we are using "Jar in exe mode" option.
Exe is generated but its execution failed. In errors.log I can see, that
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
If I add slf4j.jar to classpath, generated exe is bigger and there is another NoClassDefFoundError in error.log file.
If I try "Regular mode" and specify folder with external libs - application is working well. But to specify folder is not accessible for "Jar in exe mode".
Is there any way, to have exe which wraps jar file, and uses jar libraries which are stored in external libs folder, without manual specify them and pack them to the exe?
We don't want to distribute jar file, only exe and jar libraries in libs folder.
The JAR file in the generated executable is not protected in any way, because it will be extracted to the %TEMP% directory when the executable is started. This is why you can just use the regular mode and put the JAR file in the lib directory.
To protect the JAR file, use an obfuscator like proguard.

How to build project from Intellij Idea command line

I am automating the build process of a project that uses outputs from Visual Studio 2017 and Intellij Idea. I am using a batch file to compile visual studio project and copy the generated .exe and .dll files to build folder where the install maker program is executed from batch file. I need to compile and build Intellij Idea project and copy the generated .jar files to build folder in the batch file. I haven't found command line options to do the same. Is it possible to do the same?

How to build a no console executable script in python 3.5

I've tried using PyInstaller but with no luck. Would appreciate some help in building a no-console exe.
EDIT
In the script I am using a phantomJS and chrome drivers. I've built a system tray application for Windows. I am trying to make an exe out of the .py. Pyinstaller gives me an error about not being able to load python35 dll

Resources