0

I wrote an app for my client which is an electron app.

In order to capture the screen, I'm using a .dll library since installation can't copy DLL to system32 folder, after installation I create a batch file to copy DLL to system32 folder.

Installation, installs app to C:\Users\user\AppData\Local\Programs\

If I run this batch as an administrator, it copies DLL to the System32 folder but the app cannot access it.

If I run the installation as an Administrator instead of C:\Users\user it installs in C:\Users\admin which is same result I can not access to DLL and now app installed to the admin user.

If I run the app as an admin result still the same. Can access DLL but this time trying to access the admin's temp folder which app not working again.

Why run as admin not just installing with privileges but instead installs to that user's folder?

Side note: there is a user called "admin" not administrator, I tried to enable Administrator user which had no password. I tried to install there everything is working. I switched back to the regular user it is not working there. I tried to change ownership of the System32 folder, didn't work either. What is the problem here?

5
  • How exactly are you running things "As an administrator"? Are you right clicking the thing and choosing "Run as administrator"? Commented Mar 4, 2020 at 16:12
  • See docs.microsoft.com/en-us/windows/win32/msi/allusers. Note your actual problem is trying to copy a file into System32.
    – Mark
    Commented Mar 4, 2020 at 17:50
  • Why not copy the libraries to Program Files\<appname> or Program Files\Common Files\<appname> ? Unless other applications need to use them, that's standard. Commented Mar 4, 2020 at 19:02
  • @SeñorCMasMas Yes, I'm right-clicking and running it as an administrator. I also tried to run CMD as an administrator and run the app from there.
    – siniradam
    Commented Mar 5, 2020 at 2:30
  • @DrMoishePippik I am installing a Virtual Webcam Driver, Which can merge captured images from the second display and real webcam feed. My coworker wrote the driver told me to copy & register there.
    – siniradam
    Commented Mar 5, 2020 at 2:35

1 Answer 1

0

After a long time of tackling, I've found the answers.

1. Running installation package as an admin installs to another folder: Turns out this is a behavior of the installer, picks the folder whoever the user runs it. It is not related to the system itself. It doesn't care which user is logged in. In this case, electron-builder is the issue here.

2. Access error: Actually, the system is able to create a file in the temp folder but it says "I cannot access" is a wrong message, test with dependency walker shows there are other missing DLL files. Installing Visual Studio 2019 redistributable pack fixed the problem. But it is uncertain why it's working with (hidden/default) administrator user but not with the standard user.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .