NSIS script help-install without killing explorer - nsis

When I tried to un-install and install an executable foo.exe, Im geting the below error
Error opening file for writing
click abort to stop the installation
I could find that some files were failed to get deleted while un-installation.
And by using process explorer I can see that explorer.exe has still reference to some dlls of foo.exe even after unregistering them.
and killing the explorer.exe and re-start it again while un-installation solves the issue. (thru NSIS installation script).
or by setting rebook ok flag in script and ask user to re-start his machine before installing foo.exe again.
I don't think its a good solution to ask user to reboot his machine after un-installation .
Can anyone help me on how can I make sure that my installation goes fine instead of restarting explorer.exe

For registered shell extensions there is really no clean way to delete the dll's other than forcing a reboot (Or log-off if they are registered in HKCU\Software\Classes)
If that is not good enough you basically have two options:
Rename the .dll and delete it later
<HACKALERT>Inject a thread that calls CoFreeUnusedLibraries() into every process that has your dll loaded</HACKALERT>
Just killing and restarting explorer is not really an option since you don't know if some other program is also using your shell extension.

Related

I am not allowed to run a python executable on other pcs

I was doing a game in tkinter, then I make it executable with PyInstaller and sent it to my friends so they can run it and tell me how it feels.
It seems that they could download the file, but can't open it because windows forbade them telling that it's not secure and not letting them choose to assume the risk or something.
They tried to run as administrator and still nothing changed.
What should I do or what I should add to my code so that windows can open it without problem and why windows opens other executable files without saying that(current error that my executable gets)?
compress it as a .zip file and then it will most probably work
or install NSIS and create a windows installer for it.
I finally figured out what I had to done
When the dialog appeared u need to click more info and then it will display a Run Anyway button

Netbeans, can't save file

I have a problem with netbeans, and i can't find a solution on google.
When i try to save a file, the pointer shows loading icon, and linux wait's indefinitely.
At this moment i can't even close netbeans, and have to run kill or pkill command.
Restarting netbeans or computer doesn't change that.
If i want to be able to save a file again, I have to kill netbeans, and remove the cache
(rm -rf ~/.cache/netbeans/8.0.2/*)
If I run strace -p , it gives me :
wait4(-1,
after removing cache and restarting netbeans, i can save file only if I don't change too much lines (about 10 lines are enough to crash netbeans again)
i have no idea about what is happening, i never had this problem before.
I think it could be a svn problem, or a disk size problem but I am absolutely not sure of that
This computer is my work computer, so i prefer not reinstall netbeans if you can help me to find out what's happening.
I am working on linux (centos 7) with netbeans 8.0.2
ps : this problem is on 1 file only, i can work fine with the rest of my project's files (of course that's the file I need right now :( )
ps2 :
I found some more details.
fuser ~/.netbeans/8.0.2/lock gave me a pid of a netbeans child process (his ppid is netbeans pid).
strace -p gives me :
futex(0xa280a0c, FUTEX_WAIT, , NULL
So it seems a thread can't release futex?
Does that seems possible to you?
If yes how can I find if it's a netbean's bug or a system problem?
So after a few days looking for a solution, i may have found what's happening.
It seems the problem doesn't come from netbeans but from centOS.
Apparently, CentOS 6.6 and 7.X have an error in the futex management (a default is missing in a switch).
https://groups.google.com/forum/#!topic/mechanical-sympathy/QbmpZxp6C64
I don't know if the person who posted this is good in system administration, but after i found this post, i have found some more saying the same thing.
I don't use the solved button right know because i'm waiting for the administrator to look at this, but I post what I found if it can help someone else.

Cygwin Installation Hangs - man-db

I am trying to Install Cygwin 64 bit on a Windows 2012R2 (64 bit).
Downloading and initial setup went through but when it reached man-db (/etc/postinstall/man-db) the setup hangs
and remains so forever. I waited more than 1.5 Hours but still no progress.
I checked log file in /var/log/setup.log which has following contents.
Updating index cache for path `/usr/share/man/man1'. Wait...
Processing manual pages under /usr/share/man...
/usr/bin/mandb: warning: /usr/share/man/man1/col.1.gz: whatis parse for col(1) failed
/usr/bin/mandb: warning: /usr/share/man/man1/imv.1 is a dangling symlink
/usr/bin/mandb: iconv_open ("UTF-8//IGNORE", "utf8"): Invalid argument
/usr/bin/mandb: warning: /usr/share/man/man1/mc.1.gz: whatis parse for mc(1) failed
I am not sure if I should cancel and start again. Will this setup come out of this stage with at least some error?
Did anyone install 64 bit Cygwin and got this error ?
Please help
Happens to me often. I was setting up 8 servers this week and it happened to 3 of them. Waited many hours and it is still would not finish. Sometimes the re-installation works, some it does not. So I have resorted to kill the mandb.exe process and that allows the installer to finish normally. So far I have found no side effects of doing so.
After waiting for more than 3 hours, I decided to cancel the setup. Then I tried a reinstall, following the steps exactly as in the first install. I did not add or remove any packages. The already selected packages in the first attempt were recognized as installed. This time, the setup stopped at the above step (man-db) briefly and then completed the installation. No errors. So, re-installation solved my problem.
Late to the party, but —
When mandb.exe hung, I killed its parent bash.exe via Task Manager and the installation completed.
I then killed mandb.exe in Task Manager, since it was still running.
I then opened a Cygwin shell and ran mandb -cds. -c recreates the index, -d prints messages (so you can actually tell it's doing something constructive!) and -s suppresses checking for orphaned formatted manual pages ("stray cats").
As I write this, mandb is still chugging along, three or four hours later, with plenty yet to go.
So I'll remember to file a bug report later :) , I did notice one oddity during the mandb run:
mandb: /usr/share/man/man3/jN.3 is self referencing
mandb: warning: /usr/share/man/man3/jnf.3.gz: bad symlink or ROFF `.so' request
I've been struggling with the same problem today until I realised that moving the main Cygwin setup window revealed a popup complaining about "can't open (null) for reading: no such file"
This happens multiple times in a (re)install

How do i resolve the procedure entry point_impure_ptr error in cygwin/opencobol?

Whenever I try to run my .exe cobol file, i get this error..
fileName.exe Entry Point Not Found
The procedure entry point_impure_ptr could not be located in the dynamic link library cygwin1.dll
I am using OpenCObol and cygwin ver1.7.15.thanks
You'll need to specify the proper path for the command below, but Cygwin seems pretty persnickety with entry point addresses and updates, The system includes a rebaseall command to help fix this problem. Most times I've witnessed it is after a setup.exe pass, while the Cygwin system was still active (and perhaps only in the background and not visible).
C:\Users\btiffin\cygwin\bin\dash -c '/usr/bin/rebaseall'
Run that from a Windows CMD shell (while Cygwin isn't active, say after a clean boot and before running the Cygwin shell. Basically cygwin1.dll can't be open). You'll need to use the proper Windows path to dash for your particular install. Google Cygwin rebase for detailed articles.
I had a similar error message after upgrading from cygwin version 1.5 to 1.7. I solved it by completely removing and reinstalling 1.7 from scratch. I was told there might have been a problem with multiple versions of dlls.

Cygwin error: "-bash: fork: retry: Resource temporarily unavailable"

I recently reinstalled Cygwin on my computer in order to get access to several command line elements that I was missing. I have never had previous difficulty with Cygwin, but after this reinstallation, an error message continues to appear after (almost) each command entered. For instance:
-bash-4.1$ wc m1.txt
3 [main] bash 2216 child_info_fork::abort: data segment start: parent(0x26D000) != child(0x38D000)
-bash: fork: retry: Resource temporarily unavailable
2013930 4027950 74968256 m1.txt
Generally, the command still runs (as seen above), but not always. Occasionally, the 'error' message occurs several times in a row (the initial number "3" will then change to a "4" or "2", notably if I start a second Cygwin window.
Also, as soon as I start up Cygwin, I get the following message before the prompt:
3 [main] bash 6140 child_info_fork::abort: data segment start: parent(0x26D000) != child(0x36D000)
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable
-bash-4.1$
At the moment, I am debating whether to uninstall/reinstall Cygwin again or just live with the error messages, but I was curious if there might be an issue that I am unaware of.
(assuming Cygwin is installed at C:\Cygwin):
Open Task Manager and close any processes that look to be Cygwin related.
Open C:\Cygwin\bin in Windows Explorer
Verify that dash.exe, ash.exe, rebase.exe, and rebaseall exist in this folder
If any of them are missing, re-run Cygwin setup and select the dash, ash, and rebase packages
right-click your C:\Cygwin folder, uncheck Read-only (if its checked), and press OK.
When an error about not being able to switch some files comes up, select "Ignore All". Wait for this process to complete.
Browse to C:\Cygwin\bin in Windows Explorer
Right click dash.exe and click "Run as Administrator". A command Prompt should appear with nothing but a $
Type /usr/bin/rebaseall -v, hit enter, and wait for the process to complete.
If you get errors about Cygwin processes running, try Step 1 again. If that still doesn't work, Restart your computer into safe mode and try these steps again.
A commenter noted that, depending on your settings, you may have to type cd /usr/bin && ./rebaseall -v instead.
Try opening Cygwin again.
This process worked for me. I hope it works for you guys too.
Source: http://cygwin.wikia.com/wiki/Rebaseall
I would like to add the following to the above answers, as it is what I had to do after reinstalling Cygwin:
Navigate to the "/usr/bin" directory (usually, C:\cygwin\bin) and right click, Run as Administrator the file: dash.exe
Then, at the $ prompt type the following, hitting enter after each line:
cd /usr/bin/
/usr/bin/peflags * -d 1
/usr/bin/rebaseall -v
What it does is, it marks the dll's as "rebase-able," and then rebases them. You have to have peflags.exe in addition to the above files (in previous answers). You may have to restart windows after doing this and you will definitely need to make sure that there are no processes nor services belonging to cygwin running. (Use task manager, kill any related processes, and then under the services tab look for any service starting with CYG and stop it.)
After doing this, I was able to get cygwin to run without any errors about dll's being loaded to the wrong addresses aka fork errors, etc.
I hope that this helps others, as it was a pain to find.
SOURCE: http://www.cygwin.com/faq.html#faq.using.fixing-fork-failures
and the rebase README file.
To add on to other answers here, we ran into the same issue but could not run the rebase command from the ash or dash shell. However, when launching the command from the Windows cmd shell, the following worked.
cmd /c "C:\cygwin64\bin\ash.exe /usr/rebaseall -v"
-v is to get verbose output
I found another information here :
http://cygwin.com/ml/cygwin/2014-02/msg00531.html
You have to delete the database at
/etc/rebase.db* and do in a "ash" windows :
peflags * -d 1
rebaseall
It works for me on 2 servers.
I solved this problem by restarting my computer. Probably installed a driver update and kept using sleep instead of shutting down.
Experienced the same issue when loading Cygwin with cygiconv-2.dll forking and not loading successfully in the Cygwin terminal, but after turning off my AntiVirus (it was specifically Ad-aware), the issue resolved, and Cygwin worked properly.
In case you are using babun's Cygwin, after rebaseall, try launching Cygwin by executing .babun\cygwin\cygwin.bat in a Windows command prompt or Windows explorer.
This works for me (while launching babun's default console - mintty results in fork error).
I had the error on win10 and i was trying to rebase to c: before install.
then i saw that the installer was installing it instead to c:/Users/myuser
so i was coping all files from c:/Users/myuser to c:.badun
and then restart plus open badun.bat
not shure if this was wise its now duplicated XD... but then it worked again.
Rebaseing didn't help in my case. In addition to what other people suggested, I noticed that reducing the length of PATH environment variable fixed the issue for me (and for other people as well as can be seen from this answer).
This issue is intermittent in nature & I found this issue when there is network is too slow to connect to remote machine on AWS.... I have Shell script that runs through Gitbash shell & it connects to AWS EC2 instance with ssh..... Most of the time, it ran correctly but 2 out 100 times it get into this issue bash: fork: retry: Resource temporarily unavailable .... Killing the MSYS2 terminal from task manager helps to overcome with this issue....
Negative side is you need to run the scripts from the beginning...
I had the same issue on Windows 10 and the mobaxterm app (which uses cygwin) and I tried all of answers listed here however for me, the solution was to simply delete the "CryptoPro CSP" application.
I started facing this problem after upgrading to windows 10. As of now I do not see that any of the above method working.
What I am noticing is that if you start cygwin with admin right (right click and say "run as admin") then it works fine.
Or you open cmd as administrator and then launch cygwin from there, then also it runs fine.
Just reinstall cygwin and select TCL and activate EXPECT

Resources