I am not allowed to run a python executable on other pcs - python-3.x

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

Related

Easier way to create python executable standalone program in window

Creating a python executable in pycharm is harder than creating it in visual studio or creating a vb.net executable.
I thought I'd understand how to do this already but it looks like I have not.
I created a question regarding this in Dec of last year, here >> Create a simple python executable program and an icon to it - Hello World.
But I don't understand the answer or if it was answered completely. So I did my research again and found 2 helpful sites below that helped me create python executable without visual studio involved,
https://pythonhosted.org/PyInstaller/installation.html
https://pythonhosted.org/PyInstaller/usage.html#using-pyinstaller.
I followed the instructions exactly:
In command line, set path to C:\Python34\Scripts, then type pyinstaller "C:\Users\Desktop\PROGRAMs\TEST22.py".
This creates a TEST22.spec file in C:\Python34\Scripts and creates a folder TEST22 in C:\Python34\Scripts\dist and in there, are the TEST22.exe. I click on this executable to run the program, it runs completely fine. But when I copied the executable to the desktop, for example, it doesn't run. It seems like in the scripts folder there are files needed to run it and when it's a stand alone program there are no file to run it. Could someone let me know an easier way to create executable and please advise me on how I could fix it when the executable is copied to desktop or anywhere else and run it ?
Your answer lies in pyinstaller documentation. The dist folder itself is a standalone program directory. To get a single file exe with pyinstaller is not possible even thou pyinstaller has -F option for single exe since it dosnt contain data files.
I would suggest use py2exe and inno setup for creating installer

how to use exiftool with cygwin basic startup

ok here is the situation. I'm a complete newbie at all this and have no idea what is going on. Currently I have a race website with thousands of photos and each time I basically upload via FTP to a temporary folder and use Cygwin with exiftool (I think) to tag each image and then use Cygwin to move them to where I want on my website. During the process I make a filename.sh file and then do a chmod 755 and then tell it to run and I can tag several thousand photos individually with my filename.sh file data. All that is good. Most of the time. haaha.
My question is I want to keep the images on my desktop and tag them using the same steps and then FTP them to my site. So I think what I'm trying to figure out is how to get exiftool to work on my desktop computer the way it works on my website.
I tried to do all the right things, but when I run the filename.sh file it says:
exiftool command not found
What do I need to do? Any help would be greatly appreciated. Thanks!
install perl
then cpan Image::ExifTool
done.
The exiftool command is available through Cygwin Ports, an extra package repository for Cygwin.
To install:
Follow the Cygwin Ports installation guide (summarized here)
Download the regular Cygwin installer from https://www.cygwin.com/
In a cygwin terminal, run cygstart -- /path/to/setup-x86.exe -K http://cygwinports.org/ports.gpg. The Cygwin installer should open.
On the Choose Installation Type page, select "Install from Internet".
On the Choose Download Site(s) page, select a regular cygwin distro mirror, then enter ftp://ftp.cygwinports.org/pub/cygwinports in the User URL field and press Add. Select both, then click Next.
At the Select Packages screen
Set the View dropdown to "Full"
Search for perl-Image-exiftool
Click it to install it
Continue to click Next until the installation completes
https://sourceware.org/cygwinports/
https://sourceforge.net/projects/cygwin-ports/

Can't run .run file using cygstart

I am trying to run a .run file in cygwin, but I always seem to get this error:
Unable to start '~.run': There is no application associated with the given file name extension.
I needed to be a superuser, so I tried using the command: cygstart --action=runas "$#"
I read somewhere that cygstart is for invoking registered Windows handler, so this may be the problem, but I am unsure. Is there any way that I can run my .run file as a superuser using cygwin?
Well, as has been said, no application is associated with .run files on your
system. So you can do that one of two ways
Call the file with the program, example
cygstart notepad.exe ~.run
Tell the registry what to do with unknown extensions
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Unknown]
#=""
[HKEY_CLASSES_ROOT\Unknown\shell\Open\command]
#="notepad.exe \"%1\""
This question is not related to Cygwin but rather to Windows. cygstart works the same as Windows' start. That means, if you use [cyg]start file.extension it works very similarly as if you double-click on that file in Windows Explorer.
Therefore if you configure Windows to do what you need when you double-click on your *.run file, cygstart will work fine too.
I think that easier is to use appropriate extension which Windows already knows. It depends on what you have inside your *.run file. If it's executable, use exe extension, if it's batch script, use cmd or bat, if it's JavaScript, use js etc.
If you use Linux or some derivation, you need to execute the .run file with an absolute path, even if you have already navigated to the appropriate directory containing the file. See here:
http://the-chronicon.blogspot.com/2011/08/execute-run-file-in-current-folder-from.html

Xampp on linux mint

im trying to install xampp on "new" linux mint machine.
However im quite a noob to linux since i havnt used it for that long.
When i try to run the file that ive download from the following page:
Xampp download
i get the following error two errors:
Could not display "/home/marc/Downloads/xampp-linux-x64-1.8.3-0-installer.run".
and if i click yes
Installing mime type handlers isn't supported
To search and install software which can open certain file types you have to install app-install-data.
can anyone tell me what the problem is and how i might fix it?
you need to execute the file (e.g. open a terminal, navigate to your Downloads folder and run bash xampp-linux-x64-1.8.3-0-installer.run (possibly it might need to be run otherwise, but thats my best guess)).
alternatively you might be presented to run/execute the file (instead of displaying it). if so, choose this option.
on the other hand, you might consider installing apache/php/mysql via your package manager.
what you can do is that you can use the chmod +x /your folder location/.run file that you want to install
after that you can run following command
./and your .run file name
example:-
in my case :- User#user~$su root
it will ask for password so give it
User#user~chmod +x /Downloads/xampp-linux-x64-1.8.3-0-installer.run
User#user~./xampp-linux-x64-1.8.3-0-installer.run

NSIS script help-install without killing explorer

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.

Resources