Windows 7 - Eclipse now needs me to run as administrator - eclipse

I installed Eclipse (Kepler) on this W7 64-bit machine and initially I could run it "normally" by just clicking the desktop icon or whatever.
Then I replaced the whole "workspace" directory with one from another machine (because I'm changing systems).
Now if I run Eclipse not "as administrator" it opens and will even run apps... but nothing can be saved, including changes to files and updates to the .metadata of any kind.
I changed all the "ownership" and "permissions" which could possibly be involved. I am the only user of this machine, and I am in the administrators group. I CAN still use it, if I run "as an administrator". But I'm stumped why the UAC should have been happy to run Eclipse before without the "as 'strator" but now refuses...
Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator". So what's changed?
I have the option of uninstalling Eclipse and reinstalling it, and then incrementally adding the various project folders... fine, it may work. But I like to understand these things as far as is feasibly possible!

Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator".
UAC doesn't do anything like that. UAC is an ability of Windows to run an application as an administrator. There are three four ways an application can be run as an administrator (causing the UAC consent dialog to appear):
you right-click the application and select "Run As Administrator"
the application has been manifested with a requestedExecutionLevel of requireAdministrator
the application has a filename that looks like a setup application (e.g. setup.exe, install.exe, update.exe), in which case the Shell opts to run it elevated just in case
you call ShellExecute with the runas verb.
i think there's one of two things happening:
you missed a spot, in which case you should use Process Monitor to look for Access denied errors
you tried copying files to a protected location (e.g. Program Files) and they were instead redirected to:
C:\Users\Mike\AppData\Local\VirtualStore\Program Files(x86)\Eclipse
And then when you run Eclipse, the files are not there.
Again, use Process Monitor to find where Eclipse is looking for what.

Related

How to fix msedgewebview2 error in VS2022 when admin?

I have installed the relatively fresh Visual Studio 2022 on a Windows installation. The work I do often requires administrative privileges (local IIS). To do this I have two users, one 'normal' account that is logged in to Windows and one administrator account. When starting VS2022 with the administrator account, an error keeps coming. It happens especially during debugging and it reads as follows:
Microsoft Edge can't read and write to its data directory:
C:\Users\<administrator_user>\AppData\Local\Temp\VSWebView2Cache\<guid>\EBWebView
What appears to happen is that Microsoft Edge WebView2 (msedgewebview2.exe) is running as the user that is logged in to Windows, while trying to write temporary files for the administrator user where it does not (and should not) have write or read access.
Here we can see the process details that says the application user is the logged in user and not the administrator:
Does anyone know how to fix this issue?
The error happen even when I run debugging on a .net 5 console application. In that particular situation I don't see why it needs to run anything in a WebView instance, but apparently some background process is running something anyway. Is this something that can be turned off?
My best solution so far is to create a shared folder.
I decided to make C:\Users\<administrator_user>\AppData\Local\Temp\VSWebView2Cache\ shared. The "VS" prefix indicates that this is a Visual Studio-specific folder, and I think it is acceptable that my normal user can have access to that folder as it seems to contain temporary Visual Studio files.
To do so I logged in to Windows with the administrator account.
I navigated to the folder and made it a shared folder. I added my no-admin user with "Read/Write" privileges.
I then tested by logging out of the admin account and into my no-admin account. There I first tried the full path in File Explorer and was granted access to the folder. I then tested with VS2022 and during debugging no error box appeared and files were generated in the folder.
If anyone finds a better approach, I'd really like to hear about it. Also if you have knowledge to why this approach is either good or bad, that would be highly appreciated as well.
I only had to create the folder "VSWebView2Cache" with my normal Windows account and after that it worked.

Disabling auto updates install switch?

In my current environment VsCode is being deployed to users through SCCM so they have the ability to install the app without admin rights. The current installation supports switches such as /Silent etc, but doesn't seem to have any other switches that would define auto updates to be off by default when the app is installed. The reason for this as I'm sure you're all aware VSCode will prompt the user letting them know there's an update avaliable. Done some digging already and as detailed, you can change the settings.Json file to disable the updates, which would be great if this was a 'system wide' i.e (C:\Program Files\Microsoft VS Code) settings file, but as detailed Here it points to %appdata% (User settings).
So, in theory you could query the user on the install and then just do some powershelly magic to chuck the required json data into that settings file and the user would be away and wouldn't have to manually turn off auto updates However SCCM installations install as an elevated account (system) not as the individual user running them so it doesn't appear feasible to manage it that way.
So fundamentally if there was a way/switch that would allow the auto update feature to be disabled on install or as a post install step I'd be very grateful for any clues on how to achieve this.
Thanks!
To achieve this with SCCM you can do the following (I will describe this for a package\program it is however also possible to achieve with an application, the options are pretty similar there):
Create a installer program the same way you would if you did not want to deploy settings (something like VSCodeSetup.exe /VERYSILENT /MERGETASKS=!runcode as your commandline and in the programs "Environment" tab select "Run with administrative rights")
Create a second program that copies (or creates) a settings file in the way you want it to %appdata%
In this second programs options in "Environment" set "Program can run:" to "Only when a user is logged on" and "Run mode" to "Run with user's rights"
On the "Advanced" tab set "When this program is assigned to a computer:" to "Run once for every user who logs on"
Deploy both programs to your collection
With this setup SCCM basically does what you want split into two different setups for the respective rights needed. There will be short times where the program is installed and the settings are not yet applied (can be shortened by setting "Run another program first:" in your config setup to the base setup but this makes things a little more complex and still if a new user logs in some time during a windows update job there will be delay until the settings are deployed) but the only way to guarantee that there is never a time where the settings are not applied is by replacing the default program start with a script that sets your options.
The settings JSON (likely the one which is being deployed with SCCM) just needs this entry:
"update.mode": "none"
While by default it has the auto-update channel enabled:
"update.mode": "default"
A post-install script could do that - but while it's located in %appdata%, the user still can change it.

How can I tell why Web-start terminates with no confirmation after security confirmation?

I have a shortcut to a java web-start jnlp on my desktop. When I double click it, WS downloads the jnlp, and I assume other out of date jar files, then notifies me with "Security Warning", because our app sometimes requires users to manipulate files and such. After I accept the risk, and click "Run", the security warning disappears and the program is never heard from again. What can I do to figure out the cause?
I have tried moving the launch to a .bat file and running it there with a pause at the end, but there is still no output as to why it terminates without indication.
call "C:\Program Files\Java\jre7\bin\javaws.exe" -verbose -wait "http://devweb.corp.generasolutions.com/magcore/MagCoreDev.jnlp"
pause
This jnlp works for other people, there must be something on my machine that is causing this reaction.
I finally found something. When I run the java control panel, it was telling me that all 7 installed versions of java were enabled. I disabled all but the one I am using for webstart and now my WS program starts.

Installing other installers?

I'm tasked with reducing a 50-page installation manual to "much less"; a bunch of applications need to be installed in a specefic order, with specific options, and so on. Can I use any of the popular installers (WiX, NSIS, Inno Setup) to automate this process, or do I need to use Powershell?
I've read about what these installers can do, and as far as I can see they're designed to install one application to one computer -- I haven't seen that or even if they can be used to control other installers in a very detailed fashion -- "use this, this, and this option on this wizard page, but not that one on the next wizard page, and install to this path, then enter these details (users, whatever)".
Am I wildly over-understanding what these tools can do? Given that I need to do this, what's the best way to go about it?
Update 2: I learn that installers do offer silent install by way of a config file. Neat! I'm currently looking at NSIS (spawning Powershell scripts and other installers) as the option that's easiest to just start & go with. I like that I don't need a custom IDE for it. But I'm also wondering wether NSIS is (soon) obsolete, in a Windows 7&10 world?
You should look at WiX with a custom bootstrapper UI. That can be used to install any number of setups in whatever order you want. The tricky question is whether all those setups need to show their own UIs, one after the other. If they can all be installed silently with command line paramaters, then your WiX bootstrapper could show your UI to collect all the options, and then install each of the setups silently while you show progress for the entire operation. You could also get a single entry for the entire package in Programs&Features. So something like WiX could do it, but the UI requirements could make it awkward.
PowerShell CAN do it, but it's through invoking COM objects and sending keys to the window, so it's not the BEST way to do it. I'm going to repost something I posted yesterday to a similar question about using PowerShell to uninstall some unwanted software.
QFT:
PowerShell isn't going to interact with the prompts... you can't just tell it to click "Next" in an executable because it can't see it.
You can send keys to it though. You're really just using COM objects.
So, first, get your process ID by setting a variable that contains an array, the data for which is defined by the name of your process. Let's say your process is called, "Uninstall" and the process is ALREADY RUNNING:
$a = Get-Process | ?{$_.Name -eq "Uninstall"}
Start the COM:
$wshell = New-Object -ComObject wscript.shell;
Bring the uninstallation program with this process ID to the front so we can send it keystrokes:
$wshell.AppActivate($a.id)
Give it a few seconds to bring that window forward. I chose 5, but if your machine isn't stressed, 2 is probably enough:
Start-Sleep 5
Now start telling it what keys you want to send. The syntax here is this: whatever is in the () is what will be sent. The position in the single-quote is the keystroke to send, after the comma is how long you want it to wait before proceeding. Assuming the first screen is "Next" you can send your first command by telling PowerShell to send the ENTER key and wait 5 seconds:
$wshell.SendKeys('~',5)
The wait function is optional, but for your purposes, you're definitely going to want it. (If you don't want it $wshell.SendKeys('~') would send the ENTER key and immediately move to the next command.)
Walk through the uninstallation yourself manually, using all keystrokes, and for any keystroke you send, pay attention to how long it takes before the next part of uninstallation is loaded, and wait longer than that with your script (e.g. if it processes your ENTER key instantaneously, I'd have it wait 3 or 5 seconds before it sends the next command. If it takes 5 seconds to load, I'd tell it to wait 10 seconds before sending the next command).
Letters are letters, and numbers are numbers. Most non-commands are just assigned to their keys (meaning if you want to type "K" your command would just be $wshell.SendKeys('K')) You can get the rundown for the specific keys here: https://msdn.microsoft.com/en-us/library/office/aa202943(v=office.10).aspx.
/QFT
You may want to look into Auto-It, but that's based on pixel, last I checked, so if you run it on machines with different screen resolution, it can cause problems.
How you approach this really depends on if these other installers supports silent mode and/or answer files. This page list the options for some of the popular installers.
If they do and you decide to use NSIS then you would just do something like this:
Name "BundleInstaller"
OutFile "bundlesetup.exe"
RequestExecutionLevel Admin
Page Components # Comment out this if you don't want the user to have a choice
Page InstFiles
Section -Init
InitPluginsDir # $PluginsDir directory is deleted when the installer quits
SetOutPath "$PluginsDir"
SectionEnd
Section "Foo v1.2.3"
DetailPrint "Installing Foo"
File "FooSetup.exe"
ExecWait '"$PluginsDir\FooSetup.exe" /S /D=$ProgramFiles\Foo' # This is the syntax for NSIS installers
SectionEnd
Section "Bar 2015"
DetailPrint "Installing Bar 2015"
File "BarSetup.msi"
ExecWait '"MSIEXEC" /qb /i "$PluginsDir\BarSetup.msi" REBOOT=ReallySuppress'
SectionEnd
Section -Cleanup
SetOutPath "$Temp" # Release current directory lock on $PluginsDir
SectionEnd
If this solution is not possible then you are looking at some form of automation like the other answers have suggested.
I'd say there are two forms of automation; one where the app you are automating has to be the active window and the other where you send messages instead of keystrokes.
Just sending Enter to the active window with some sleep's thrown in is of course the easy solution but it can break if somebody starts interacting with the machine.
NSIS supports commands like FindWindow and SendMessage and I assume AutoHotkey does as well. The advantage to using FindWindow to find a specific HWND and then sending it a message directly is of course that the application does not have to have keyboard focus. This approach requires a bit more work but the end result is better because you only use SendMessage after finding the right window (and you can make sure the window/control is visible and enabled etc) so you know the application is in a known state without having to hope that the sleep was long enough...
Installing other installers is no problem with any decent installer builder.
These other installers are either msi, exe or zip files.
I do not assume that the installers (for SQL database servers and the like) offer silent install (by way of a million command-line parameters or a config file).
I highly doubt I can launch these installers in silent mode (with a million command line parameters)... :-(
Fetch the installer for the SQL database server and check it.
Most of the installers offer a silent install.
msi or exe files created by another installer builder accept CLI arguments to select components and set the target path
even exe files created as SFX archives accept a target path for the unpackaging
some installers do not provide all form-fields of their GUI configuration dialogs as CLI parameters. for those installers you would need a post-configuration step, which might simply consist of copying a default config file into the application folder
Yes, its also possible to center an installer around the idea of "gui automation" or "inserting keystrokes" using AutoIt, AutoHotkeys or any other Automation tool from inside the main installer.
You would need to build an automation script for each installer and execute it from the main installer. Its probably nice for testing and replaying the individual component installations.
But YAGNI.
Given that I need to do this, what's the best way to go about it?
Make a full run and note all the installation steps.
list the installers you need
find the download urls
download the installers
download additional tools you need (unzip?)
for each installer check the CLI arguments it accepts
check if you get a decent default configuration, when leaving some CLI args away
install each installer from the CLI into your target location
Then translate the steps you have into the Installer builder of your choice. Its mostly copy pasting CLI commands into Exec() or ShellExec() calls, followed by copying config files and fiddling around with cross-component configuration.
I haven't seen that or even if they can be used to control other installers in a very detailed fashion
Just think of all the game installers shipping DirectX or the pre-packaged web-development stacks like XAMPP or WPN-XM (speaking of the last: you might take a look at this InnoSetup script file).
A wrapped installation of multiple software components is pretty common.

Install4j "Browse" Button hanging the installer

I'm using install4j 6.0.3, everything works exactly like it should, however if the user tries to change the installation location by using the "Browse" button, the installer locks up completely, and you need to use task manager to kill the process.
This happens on Windows 7 & Windows 8(.1)
Does anyone have any idea of how to fix this issue?
Ok, this is extremely weird, as I was debugging according to Ingo, I checked the option "Allow new folder creation" on, made a build, then checked it off again and made another build.
That build now works for the affected users, I guess there was a latent weird option in the config file or something.