Remove appData after uninstall Electron app - electron

I want to remove the appData after my app was uninstalled.
The deleteAppDataOnUninstall: true option was useful when i run the uninstaller.exe,but not work when i install the app again.
When I want to install a version v2 to cover the version v1 existed in computer,i want to remove appData and create a new one.
I use the include: installer.nsh to do this.
!macro customInstall
RMDir /r "$APPDATA\${APP_PACKAGE_NAME}"
!macroend
But the question is:
$APPDATAvariable in nsis is C:\ProgramData,the appData path I got in Electron app.getPath('userData') is C:\Users\user\AppData\Roaming
What should I do to remove the appData folder got from app.getPath('userData')?

$AppData depends on the SetShellVarContext setting. In your case it has been set to all and this means you are doing a all users install and you should not really modify a users profile.
If you want to ignore this advice then make sure you have v3.08 and use $USERAPPDATA.

Related

nsis installer removes existing app links in start menu subdirectory

I'm using electron-builder to build an NSIS installer for our Electron app.
We have multiple applications all added to the start menu under a Company Name directory. On first install everything works as expected but on upgrade/reinstall the installer is removing all the other app shortcuts from the the subdirectory. Using these steps its easily reproducable.
I think it might be something to do with this cleanupOldMenuDirectory macro but I don't know enough about NSIS scripts to work it out.
I don't know anything about electron-builder but I do know that RMDir in NSIS will only delete empty directories and RMDir /r will delete a directory and everything in it.
The change on January 2nd should have fixed it as far as I can tell.
One way to find out if this macro is the culprit is to modify your electron-builder installation and add a MessageBox MB_OK "Hello" line to the start and end of the cleanupOldMenuDirectory macro. If the other shortcuts exists when the first MessageBox is displayed and they are gone when the 2nd MessageBox is displayed then you know where the issue is.

yeoman creates project in Desktop even though I CD into directory

I am having a issue creating a yeoman project. I cd in the directory type yo and it says:
Here is it suppose to asked me project name etc and it wants to throw everything on my desktop not the file I cd into. It defaults to mvn and I want gradle. I even npm uninstall -g generator-jhipster
and reinstalled it and got the same issue.
If you have a .yo-rc.json file in a parent directory, Yeoman will load that configuration and generate from that file instead of prompting. This allows developers to run a yo command from any folder in the project and have it apply to the correct files.
To solve this, remove the .yo-rc.json from the parent directory, in your case /Users/drew/Desktop.
For example, if you are in the directory /Users/drew/Desktop/new-project but /Users/drew/Desktop has a .yo-rc.json inside, Yeoman will change to the parent directory (Desktop), load the configuration, and generate the files from that folder instead of the child folder.
Based on your log it's looks like you are running yo in a folder where a .yo-rc.json is already existing. Careful under windows the .yo-rc.json can be that is of type hidden and you can't see it in explorer. Because of an existing .yo-rc.json you are not asked anymore for info e.g. project name, build tool etc. My recommendation will be to create a new folder run inside yo command

Can Delphi 6 be installed in Windows 7/32

Trying to install D6 in a W7/32 machine I run into issues:
- Error message on start when D6 tries to rename file in C:\Program Files.
That particular folder does not exist, and cannot be created,
due to a conflict with C:\Program.
I therefore attempted an install in the manually created C:\DELPHI6.
That seems to work.
Is this a good and correct way to install, or should I do it differently?
try create folder and chose directory to like draw this :
or try open setting option folder chose show hidden files

Downloading JUST the iOS Facebook SDK, not the freaky package?

We all love the Facebook SDK for iOS, if you go here to download it,
https://developers.facebook.com/docs/ios/getting-started
for some reason you get this sort of insane .pkg file,
which APPEARS TO ONLY create the "FacebookSDK" folder in your "Documents" folder.
Then you just move it where you want, wondering "Why the hell do they do that?"
Does anyone know
Is there on Facebook.com an official link somewhere to simply a zip of the library?
Is there a reason they use the package system? (Does it -- check on versions, or something - does it check you have needed stuff on your Mac maybe?)
Does it drop any crap anywhere that one has to clean up? Is it mildly malicious at all?
The installer also installs the docset.
You can check in Terminal to see what's going on:
First, expand the installer from inside your Downloads directory:
$ mkdir facebook_sdk
$ cd facebook_sdk
$ xar -xf ../facebook-ios-sdk-3.15.1.pkg
This will create a new pkg file which is just a directory. cd into that and unzip the Payload:
$ cd FacebookSDK.pkg
$ cat Payload | gunzip -dc |cpio -i
Then open the directory in Finder to browse the contents:
$ open -a finder .
You'll be able to see what gets copied where, and you can just pull out whatever you want:
To answer your questions more specifically:
Is there on Facebook.com an official link somewhere to simply a zip of the library?
To my knowledge, no, but you can use CocoaPods to get it.
Is there a reason they use the package system? (Does it -- check on versions, or something - does it check you have needed stuff on your Mac maybe?)
It might remove old deprecated files when installing new versions, and it makes it easier to install the docs.
Does it drop any crap anywhere that one has to clean up? Is it mildly malicious at all?
It's not malicious. You might not want the docs if you're tight on space.

How can I fix user dir permissions for my Cydia app?

I am having an issue with my application hosted on Cydia.
Users are complaining that the app crashes on startup.
The app uses CoreData, I thought it had something to do with this.
Weird thing is that it works fine using simulator or on my device when testing.
But as soon as it is installed through Cydia it crashes.
Turns out that using "Fix User Dir Permissions" from SBSettings fixes this issue.
Now what can I do about this?
I just had a discussion with the repository guys at BigBoss about this.
I never really got a clear answer, but it looks to me like when Cydia installs your application, it doesn't necessarily set the ownership (explicitly) for your application. That seems bizarre to me. In my case, they were test-installing my app, and seeing that it was owned by user/group = { 1000 / 100 }, which was the linux user id and group id from the machine I was preparing my .deb package on!
I can also see this same behavior if I build a .deb package, deploy it to my own local test repository, and install it with Cydia (pointing at my own repo).
In any case, I explained this to them, and they did something to fix it (without anything more from me).
However, one other option is to manually fix permissions in your post install script. In your .deb package, you would have this folder and file structure:
DEBIAN/control
DEBIAN/postrm
DEBIAN/postinst
DEBIAN/preinst
If you put this in your postinst script, I think it should fix this immediately, without having to go into SBSettings afterwards:
#!/bin/bash
chown -R root.wheel /Applications/MyAppName.app/
exit 0
You can do more than that in the script, if you need other directories created, for example. But, the above will at least suffice to change ownership on the .app directory itself.
This BigBoss link recommends creating additional directories in your app's code, and points out that the installer runs as root, while your app normally runs as user mobile. Depending on what you're doing, it may be better to fix ownership/permissions in postinst (root) or in the app (mobile).

Resources