Electron NSIS prevent reinstalling - electron

Is there a way to have the NSIS built by Electron not re-install the app everytime it is clicked just like the MSI ? If the app is already installed I would like it to simply open it rather than re-installing.
I would use the MSI but when I open the app installed by it, it doesn't have read/write permissions from files inside the directory even if it is in Appdata (same folder as installation from NSIS). When installed from NSIS for some reason it gives read/write permissions to the app for files inside the installation directory.
Any help would be appreciated.

You need to edit your .nsi script file and do the check manually (skip the installation if an app is already installed) because there is no "switch" for that.
The issue with electron NSIS installers is that script is recreated every time (at least in the tutorials I saw) so you may lose any changes you made there.
In such case you cannot use the building pipeline, but you need to open the .nsi file with text editor, make the changes and compile everything with makensis.
Please post your script with more details.

Related

How to check if electron app is running a portable build?

I build an electron app that will be distributed as both portable and installable version.
I added electron-updater to get the installed version automatically updated. I see that portable version is downloading the update as well, even though it cannot update.
I am looking for a function isPortable() in electron to switch off autoupdater in portable app. For now i found out that I can check process.env.PORTABLE_EXECUTABLE_DIR for directory but I wonder if there is more straightforward option.

Distributing Electron Application Across Platforms

I developed an application on my Macbook and I followed the Application Distribution page instructions on the Electron website. So right now when I double click on my electron.app folder it runs my application perfectly. However, when I transfer that folder to my Windows machine, it just shows a folder. When I double click on the folder it just shows me its contents. How can the package be run on the Windows? I don't care about my code being exposed to others. I just want to be able to run it on Windows. Is the only way of doing so through making an exe file?
Electron has separate binary distributions for Windows, OS X, and Linux, as seen on its releases page. You will need to bundle your application's code under the resources folder in each distribution for each platform you want to release for.
electron-packager exists to make this process a lot less labor-intensive.

How to reset the download when the GetIt package manager fails?

I tried to download the OmniThread lib via GetIt when Delphi crashed.
Other packages downloaded, compiled and installed just fine, so I guess it's a once off.
Now GetIt refuses to install OmniThread, because it sees the partial download, assumes all is well and starts compiling.
This breaks with a compile error and GetIt does not allow me to reset the state and clean up the download.
Where does GetIt store its downloads and how do I clean this out, so that GetIt will redownload the source from scratch?
Luis Navarro from Embacadero just explained to me:
Close the IDE, then delete the OmniThread folder from MyDocuments\Embarcadero\Studio\17.0\CatalogRepository
After that, you have to edit the registry and delete also the Omnithread folder from HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\17.0\CatalogRepository\Elements
This worked like a charm.
Note that for me there was no registry key in the above path for OmniThread yet. Perhaps the key only gets written upon successful installation of the package.
In that case you only need to delete the PackageName directory and reinstall.

I have to open windows fonts folder after install my application by installaware

I've built a installer by installaware for my application. I'm copying some fonts to windows fonts folder automatically during the installation. When I open the installed application, fonts doesn't displayed correctly until I open and close windows fonts folder or restart the computer. Is there any solution to enable me not need to open fonts folder or restart computer? something like refresh windows newly installed fonts.
I appreciate any suggestions.
The required procedure is described over at MSDN. To summarise:
Copy the font to the %windir%\fonts folder.
Call AddFontResource or AddFontResourceEx.
Broadcast the WM_FONTCHANGE message to all top-level windows.
It may be easier to find a way to persuade your installer tool to do this work for you.

How do I run D3D9 programs (that have already been compiled) on a machine without the SDK?

I have a simple 3D application programmed in C++ and D3D9 using MSVC++ 2008 Express. Some weeks ago, I had to format my hard disk, so the DirectX SDK is not currently installed.
However, I found that the exe file that I found in my "Debug" folder for the project does not run. The error it gives is:
"This application has failed to start because d3dx9d_38.dll was not found. Re-installing the application may fix this problem."
Of course, it worked after I installed the SDK. Then I compiled a "release build" thinking that that was the solution. Then I uninstalled the SDK and tried to run the .exe file.
Still gave me the error.
So how does one make such .exe files run on machines without the SDK?
I think you cannot run the app without the SDK. See XBMC, which requires the SDK to run.
However, you could try simply placing the required dll file from your SDK in the same directory as the executable.
I followed the solution as stated here.
I copied the d3dx9_38.dll file into my Release folder. It still didn't work. However, I renamed the dll file to "d3dx9d_38.dll. Then it worked.
Wondering why I had to rename to the debug version of the file even though it was a RELEASE build...

Resources