InstallScript Reboot after multiple prequisites - installscript

My product uses an InstallScript 2014 project that has multiple prerequisites (PRQ). Sometimes one or more of these PRQs requires that the machine be rebooted. I have set the PRQ Editor Behavior tab to "Note it, fail to resume if the machine is rebooted, and reboot after the installation", and have set the return codes as 1641 and 3010, both of which indicate that a restart is required.
I interpret the Behavior setting to indicate that once ALL of the prerequisites have been installed and after MY application is installed that computer will be rebooted. However, this is not the case - the reboot never occurs.
Could it be that if PRQ #1 requests a reboot but PRQ does not, the "note" for a reboot is lost thus none occurs? This would certainly explain what I'm seeing. (The PRQ process is a black-box: There's no way to see what happens as it's running.)
If this is true, what other options do I have? Should I allow each PRQ to reboot as necessary, potentially aggravating my customers, or is there another way that I'm not seeing?

When the user runs the installer, I check if they are installed in the registry and ask the user if they would like to install them one by one if they are missing anything. If I decide that one needs a reboot, then I display the prompt to reboot the machine. It gives me complete control over how I handle the prereqs rather than using the PRQ system.

Related

Ensuring RStudio always restarts in administrator mode

Sometimes I receive notifications that I am trying to updating already-loaded packages from RStudio and am prompted to choose if I want to restart R(Studio) or not. I've noticed that sometimes I will have write permission issues after this, despite having RStudio set to run as an administrator. My hunch is that this is because I have set the permissions for a specific shortcut (see below) and not for RStudio itself (if this even happens) -- accordingly when it restarts, it isn't restarting the same way as I ran the program in the first place and thus is not in administrator mode.
Am I correct that this can happen and, if so, is there some sore of way to consistently ensure it is run in administrator mode? I'm asking this on SO since I'm guessing there is probably a way within R or on the command line to ensure this, if it can indeed happen. I'm on a single-user Windows 10 machine.

GCE: cannot login, The VM guest environment is outdated and only supports the deprecated 'sshKeys' metadata item

I cannot ssh into my Google Compute Engine (GCE) Wordpress instance anymore.
It was working one month ago when I tried last.
I use the Google built-in SSH client in a Chrome browser window.
Yesterday I tried an got the following message:
The VM guest environment is outdated and only supports the deprecated
'sshKeys' metadata item. Please follow the steps here to update.
The "Steps here" link navigates to https://cloud.google.com/compute/docs/images/configuring-imported-images#install_guest_environment which does not seem to help me much.
I am not aware of any changes that I may have made.
How can I fix this?
It looks like your instance's disk is full, and so the SSH keys can't be created in the temp directory. You can do the following:
Stop your instance and wait for it to shut down
Click on the disk your instance is using, and choose "edit" at the top
Enter a larger disk size, and save
Go back to your instance and start it up again
You should now be able to connect via SSH. While you're in there, check to see what filled up your hard disk so you can prevent this from happening again (maybe a rogue program is printing out too many logs, etc).
If you're seeing this on Debian 8 or 9, the most likely reason for this is that the google-compute-engine.* packages that allow SSH access to the instance have been removed by apt-get autoremove.
If you have an open SSH connection to the machine or can use a tool like gcloud, running apt-get update && sudo apt-get install gce-compute-image-packages should fix this.
If you no longer have any SSH access, there is a procedure available on the GCP docs site that can be used to restore it.
I've created a bug report here for this.
Might be a bit late, but you can
1) Stop the VM
2) Edit and enable serial console
3) Use the serial connection to login and update the VM
recent days, I meet similar problem, later I find the permission rights of my home directory fools me, as a lazy-bone, I chmod 777 ~
After did that, I cannot ssh via my terminal, even cannot ssh via browser, only get 'The VM guest environment is outdated and only supports the deprecated 'sshKeys' metadata item, Plese follow the steps here to update'. Sounds like you must set 755 to your home dir, not just care your 700 .ssh or 600 authorized_keys.
I met the similar issue after I created a FreeBSD VM, gcloud ssh not works, but I am lucky that I can use the browser window ssh to my VM. Then I manually add the google_compute-engine public key to the .ssh/authorized_keys, now it work, I can use the gcloud ssh to connect. But not sure if this is a better/security way.

windeployqt.exe not working ? Application does not start

I have a simple application using
QT += core gui network webkitwidgets
I've used windeployqt.exe to generate the 32 bits release on my win-10 64 bit computer. When I put the folder on a win-7 64 Bit desktop and double-click the app.exe, it never starts.
I can see it in the task manager, but I can't kill it, and if I try I cannot close the explorer folder in which I double clicked anymore.
I've checked the usual platform, ICU, qwindows.dll, and so on.
http://doc.qt.io/qt-5/windows-deployment.html
EDIT Precisions:
I've compiled with default 32 Bit kit: "build-Test-Desktop_Qt_5_5_1_MinGW_32bit-Release" with "mingw492_32"
I have a package "release" generated by windeployqt.exe using the --webkit switch. I start a command prompt:
> set path=
> set mingw=
Then I make sure that no Qt/Mingw things exists anymore in my environment variables.
I also rename "c:\Qt" into "c:\ __Qt".
I move my release folder on my desktop.
I start release\test.exe ( from the clean path shell )
Everything runs fine! So The release/test.exe has everything it needs without the path/mingw variable.
But as soon as I put the folder on another windows machine ( 7 instead of 10 ) it never starts.
I tried dependency walker. It shows a lot of "API-MS-WIN*.dll" missing...
It even shows much more missing dlls on the "good" machine than on the bad one !!!
Every single "missing dll" on the "bad" target machine is actually in system32 on this machine.
Thanks for advice, every advice is welcome, I'm a bit desperate... :)
Edit
It seems to be related to the machine itself. I have successfully deployed this (very small) app to 2 non developer machine on win7 and win8 respectively. But the above "bad machine" still resits running it...
Edit
The problem seems not to be general but related to this one particular machine. Hence, feel free to close or move to the appropriate forum as it is not related to Qt/windeplyqt. If I figure out a solution, and question is closed, I'll simply add a last edit. Safe Boot and malwarebyte are my next actions.
After a long investigation.
Do not believe dependency walker, it used to be a top notch tool but it is now outdated.
If there is a missing dll, the system will prompt you with "cannot load dll xxx.dll" anyway.
Your best shot in case a soft runs on machine X but not on Machine Y is:
start in safe mode ( run: msconfig --> diagnostic startup )
turn off any antivirus or non microsoft/driver software,
"run as administrator".
If you can run with step 3. Then proceed by elimination:
run without admin rights,
Start anti spyware, etc...
Add appropriate exception to your antivirus if it is the root cause.
If the antivirus is not the root cause, run process monitor on both machines. Then compare, what Failed on one machine and not the other ? Read the windows event log and compare any error messages on both machines.
run sfc /scannow to check disk
run a complete anti spyware scan/ pc-repair tool ( malwarebytes, combofix, ... )
Make sure you really have the very same package on both machines, make sure you are not trying to run an exe on mac OS, make sure your computer is on.
Call the oracle, you are in the matrix...
In my case the problem was Avast and it was solved by adding appropriate exception.

Visual Studio 2015 download getting stuck at applying Microsoft ASP.net

I'm currently on my third attempt trying to install Visual Studio 2015 on this computer. I have tried rebooting, hard shut downs, canceling setup and restarting, etc. Each time, it gets stuck at applying Microsoft ASP.net. I have tried leaving it overnight (12 hours). My download speed is 50-60 MBPS according to Ookla Speedtest. I am running Windows 10. I did do a "custom" installation and added C++, Python, and the Git extension. If I am not mistaken it said 7 GB size. Why is it doing this? Please help!
I don't understand why this isn't working because I installed VS 2015 for my laptop (a different computer) just a few days ago on a relatives WIFI and their speed was 3-7 MBPS.
(Note: The installer is not technically frozen since the loading dots on the bottom are moving.) However, bar hasn't filled up at all for like 6 hours.
EDIT:
Do I need ASP.NET (for C#, Python, and maybe C++)? Can I uncheck certain features for installation so that it wont try to install this? Also, when I cancel installation it never cancels and just stays there so I have to kill the installer with the task manager. This is getting incredibly frustrating.
Fixed it...
Easiest way is "threaten" to shut down the computer. Go into Power, restart system. You will be warned that there is a logging program which will not let the system reset. Cancel that program and then do NOT restart.
Installer immediately went on to next part and finished install after having been stuck for 6 hours...
I got it to work, it wasn't perfect, but here is what I did: It was getting stuck at very certain points, most notably ASP.NET. I did a little research and got an idea from something I read (I unfourtunetly can't find the source again). Sometimes windows opens invisible "confirm" type windows or installer windows that get stuck. When the installer got stuck I opened up task manager -> details, than checked On the visual studio process by right clicking then clicking analyzing wait chain. This showed me what process the VS install was waiting for. Then, I'd just kill the process. Messy, I know, but better then nothing. I had to do that 2 or 3 times. Afterward it said it installed correctly with 2 components that had warnings. ASP.NET was included. But everything else worked fine (c#, C++) Later I went back and did a repair. That worked pretty smooth. Finally, I installed the Python Tools successfully. (that part is sort of irrelevant but the point was that everything is now working fine).
edit, found another source: Visual Studio 2015 Community Edition Installation Stuck In Windows 10
Yes i had this problem too. To solve this open task manager and go to details tab then search for TiWorker.exe, right click on it and choose analyzing wait chain it will display many instances of the process that are in waiting mode , check all those processes and terminate them after doing this the installer will go to the next step.
To avoid this problem, you have to install IIS first.
Go to Control Panel -> Programs -> Turn Windows features on or off -> Select "Internet Information Services" -> OK
I had this problem a couple of hours before writing this answer and what worked for me was:
I opened other programs at least two or three and went to power and clicked on restart as usual it will warn you about open programs that need too be closed before shutdown or programs that are currently active I then clicked on force close and it closed the first program that I recently opened then I quickly clicked on cancel. Two minutes later instalation was back on track
Press Ctrl+Shift+Esc, then go to Tiworker.exe and terminate all the waiting processes.
I found a solution to this headache of a process to install Visual Studio. If you have tried everything and nothing seams to be working for you even by trying the command line shell then try this.
Go open task manager while running the installer and kill wusa.exe. It will kill the process to search for the update and continue the installation. You may have to kill some other processes as well if they get stuck. Its not great but it seams to be working.
wusa.exe seams to be the task that is the problem that prevents the installer from moving to the next step. This could be because your computer can not reach the update server.
This seams to be the case for both the Community and Enterprise Version of Visual Studio.

Why don't QLocalSocket/Server connections work when one process was invoked by an NSIS installer?

I have an NSIS installer that installs my Qt application. At the end of the install process, the installer gives the user the option to launch the application immediately.
My application uses QLocalSocket/QLocalServer to talk to other local instances of the application. (They talk to each other basically just to ensure that there's only one instance of the app running at a time.) However, on Vista, if one of the instances was started up by the installer, then other instances cannot talk to that instance unless they were also started by the installer (or uninstaller, interestingly).
The NSIS installer launches the app with the Exec command. The client tries to connect to the server through QLocalSocket::connectToServer, which fails with the error "QLocalSocket::connectToServer: Unknown error 5".
Can anyone explain this? What's the best way to work around it?
If 5 is a windows error code, it would mean access denied. Is there a way for you to change the security on this server (You would need to access the native pipe handle)?
The finish page run option has more issues than just this, the new process gets the wrong HKCU and user profile etc.
I would recommend just disabling the run checkbox on the finish page. (This issue goes all the way back to win2000 when RunAs was added)
If you really really want this run checkbox, you can use the UAC plugin, it will allow you to start a child process as the "correct" user.
Finally figured this out. The installer was running as admin (the install script said "RequestExecutionLevel admin"), and apparently it launched my app with those elevated permissions, which meant that other instances of my app running with user-level permissions couldn't connect to it. QLocalSocket/Server uses named pipes on windows, so I figure this is a windows security feature. I'm planning to work around this by using the UAC NSIS plugin, which I believe lets you run a process with user-level permissions.

Resources