Before the PC developed with electron, electron-packager the project into an executable file and then packaged it with Grunt-electron-installer to install EXE files. The most uncomfortable is that the installation does not have a custom directory, the default is installed on the C drive, and sometimes reported installation errors (installation has failed).
Grunt-electron-installer provides a configuration-style interface, and it is impossible to solve these installation problems. Have met this and solved the classmate welcome message.
At last, the production program NSIs with strong operability is chosen:
Process or the same as before package the project first
Electron-packager NPM Address: Https://www.npmjs.com/package/electron-packager
Then install NSIs and Nisedit
Open Nisedit, File-"New Footsteps" (wizard)
Create a script as prompted--reference
A heap of scripts will be generated upon completion
Click Compile
The final one will come up with an installation package.
However...
Click Install Package---"Installation Successful---" Use error
。。。。
The reason is that some logic in the project has local file operations, permissions problems caused the operation failed, error.
Continue Google ...
Found AccessControl.
Official address: http://nsis.sourceforge.net/AccessControl_plug-in
Install this plugin first
Find the NSIs installation directory, the compression package corresponding to the file copy in the installation.
Then, go back to Nisedit and use it when copying folders
Setoutpath "$INSTDIR \resources\app" File ". \.. \.. \dapp\homecloud\out-dev\homecloud-win32-x64\resources\app\license.txt " File": \.. \.. \dapp\homecloud\out-dev\homecloud-win32-x64\resources\app\logo-16.ico " File": \.. \.. \dapp\homecloud\out-dev\homecloud-win32-x64\resources\app\logo.ico " File": \.. \.. \dapp\homecloud\out-dev\homecloud-win32-x64\resources\app\main.js " ; set permissions------ AccessControl:: Grantonfile "$INSTDIR \resources\app" "(BU)" "Genericread + genericwrite" Pop $
It means to set all the files under the app to be read and write.
Then compile the script again.
Done......
NSIs Package folder Permissions---AccessControl