soliunit.blogg.se

Rar opener
Rar opener




rar opener
  1. #Rar opener install
  2. #Rar opener rar
  3. #Rar opener code
  4. #Rar opener windows

This modification will send this information to the backend, with "file:unrar" being the event to be emitted and the second parameter being the object to be transmitted.

#Rar opener code

Then go to your function called when submitting and add the code snippet: Go to the first line of the " script" html tag and add: To use it, we first need to add the dependency to our html. For this type of operation, Electron has a mechanism called ipcRenderer that allows us to create events in html that will be captured by JavaScript. When we select the file and click submit, the following alert appears:īefore we actually extract, we need to send this information that is on the front-end (our html) to the back-end (our Node.js). When running our application with the command:

#Rar opener rar

This is an opportune time to test how the application is doing and if it will log the address of the rar file. When this file is submitted, JavaScript prevents the standard event (by which it means a form submission) and instead makes an alert window with the path to the file to be unpacked. The code structure is currently as follows: there is a form with a file field that accepts only. My html will have the following structure: In my case, I made an app folder and put my index.html in it. It is up to the developer to decide the structure of the Electron project. The location of the file has been arbitrarily set. In this line, we indicate which html file will be loaded when the method is called. The last line of this event declaration serves only as a garbage collector when the application is finished we assign the value null to the variable that maintains the window. Then we create a function responsible for configuring the initial state of the main screen, and after that we have the declaration of an event that is called when the application is fully loaded ("ready" event). Next, we import two electron dependencies, app ( which contains the running application), and BrowserWindow, (which controls the main window. First, we create a variable to store the main screen throughout the application. So let's create our main file in the root of the project, called index.js:

rar opener

Inside the "scripts" object, add the line below: In the end, the "scripts" object should look like this: Now that the library is installed, let's create an instruction in your package.json file to run the application.

#Rar opener install

Once that's done, it's time to install the Electron library: This command will open a small form that must be filled in with information such as the main file and author name. To create a new Node application, we can create a folder with the project name, access it via the command line, and use the command: Ready to try it? Creating a New Node Application Electron works by raising a reduced instance of the Chromium browser, allowing us to make our graphical interface with web technologies (html and css) and make our backend with Node.js, thus enabling us to develop the logic with JavaScript and take advantage of all the variety of libraries that npm makes available. What's Electron?Įlectron is a framework that allows us to create desktop applications using Node.js. Now, there is a simple way to perform this activity that I didn't have the patience to find at that moment that said, this is a situation that can easily happen again in the multiplatform world we live in, so I decided to use the opportunity to make a RAR file extractor using Electron as a way to demonstrate how the framework works and to have an application that can save me some time in the future should the situation arise again. But what if I had needed to open them on my MacBook?

#Rar opener windows

I researched several lengthy tutorials and finally ended up sending the file to a Windows virtual machine where I quickly solved the issue. Have you ever needed to extract a ".rar" file on a MacBook? I have to confess that I was extremely stressed when a friend sent me some compressed files one day and I couldn't find a simple way to open them.






Rar opener