How to directly open .m files with octave GUI - windows

My problem is with Octave on Windows.
I am trying to open an .m file with Octave GUI, but I don't want to run it immediatly.
Currently, when I do this, an Octave GUI window opens, as a Notepad++ window (which is empty?). This Octave window is already set to the path where my .m file was located.
Then, I have to click on "file-->open...--> myfile.m" to make the code appear in the editor tab. From there I can modify it (some parameters I want to change for example), or launch it directly.
Is there any way to directly get the file opened in Octave GUI (in the editor tab, without having to do "file-->open-->...")? Or a simple script.bat file to configure for doing this purpose?

You must unistall the older version first. Then install the newer one. If you installed newer one first and then uninstalled the older one, then it will not work. So now you must uninstall and reinstall the newer one. Then the following will work.
Select "Microsoft Windows Based Script Host" for .m files.
It is usually located in C:\Windows\System32 and named as <wscript.exe>

GNU Octave - Bugs: bug #47696, Can't set Octave as default app...
--> You have to select "Microsoft Windows Based Script Host" for .m files. Check whether the description changes to "GNU Octave Script".

Related

macos OS X equivalent of Linux .desktop file

I have developed a set of shell scripts that work on Windows and Linux and would like to distribute them for macos 10.4 and following. (They are to help language development workers in minority languages keep their software up-to-date. You can read about the project at lingtransoft LangTran.)
I make the Windows installer with Inno Setup and the .deb file for Linux with EPM. I have been able to make a .pkg installer by running EPM on a Mac, and it installs the shell scripts to the right place, and they work properly when I run them from a Terminal window, but I would like to provide clickable icons. If I can work out the macos/OS X equivalent of a Linux .desktop file, I should be able to get the EPM package maker to install the launcher files in the right place.
For Linux, EPM will package my hand-crafted .desktop files and install them in the right place for them to appear in the menu. (Here is one of the .desktop files:
[Desktop Entry]
Name=LangTranUpdate
X-GNOME-FullName=LangTran Update Script
GenericName=Software Distribution System updater
Comment=For updating a local software repository
Path=/usr/local/langtran
Exec=/usr/local/langtran/LangTranUpdate.sh
Icon=/usr/local/langtran/Progs/LangTran-icon.ico
Terminal=true
Type=Application
Categories=Network
StartupWMClass=gpodder
)
The script needs to run in the folder /usr/local/langtran because it looks for other files in the same place, so the "Path" key is set to that. The Windows shortcut files work the same way.
Since macos doesn't have a START button to open a menu tree, I would like the installer to put clickable objects on the desktop so the user can drag them to the Dock if desired.
So my question is: How do I make the macos/OSX equivalent of a Linux .desktop file or a Windows shortcut?

Compiling TCL/TK in Windows

I'm trying to get tcl/tk working in Windows 7 64bit. I've followed the readme on the main tcl's website and what I've done so far is run the make file found in the tcl8.6.1 .zip file you can get off of the tcl website. I was able to compile it with the terminal window in Visual Studio C++ 2010 professional. The make file creates a folder inside your downloaded and extracted tcl folder that you can then run and compile tcl scripts from that specific location but from nowhere else. I want to be able to compile and run tcl scripts from any directory since I'll be doing a bit of tcl/tk programming in the near future.
Stuff I've tried:
1. Copying the tclsh86t.dll file + tclsh86t.exe file to system32
2. Editing the TCL_LIBRARY environment variable but it doesn't exist :/
Any ideas?
I figured it out. In Windows:
Open a file explorer
Right click on "computer" select "properties"
Select "Advanced System Settings"
Select "Environment Variables" in the "Advanced" tab.
Edit the "Path" variable to have the location of "tclsh86t.exe" available when compiling the latest version of tcl.
When you re-open your command line, you should be able to use tclsh86t.exe from anywhere. In my case, tcl was complaining that it couldn't find a usable init.tcl file. So, I went and grabbed one from the tcl distribution and put it where it was looking and then it was fine. You can alternatively edit your TCL_Library environment variable to point to wherever it is on your PC.

Recreating PyCharm launcher in Ubuntu

I installed pycharm normally via bin/pycharm.sh, but the mistake I made was doing bash pycharm.sh while the pycharm directory has inside the Downloads folder.
I later on moved the directory to /opt/Pycharm/. This is causing the once functioning unity launcher (which was added when PyCharm was initially installed) to fail every time I attempt to use it (as expected).
How can I re-add pycharm.sh as a lauchable app from the unity launcher? I know the location of the pycharm.sh file. I've tried to add it to /usr/bin/ but that does not change anything.
I can still launch pycharm via bash /usr/opt/Pycharm/bin/Pycharm.sh. But this is tedious.
UPDATE
I have tried making a new .desktop file for pycharm, using the following script:
[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Exec=/opt/Pycharm-3.0.1/bin/pycharm.sh
Icon=/opt/Pycharm-3.0.1/bin/PyCharm_32.png
Type=Application
Categories=Development;
StartupWMClass=PyCharm
However, I get a "Unable to save Pycharm.desktop" error when I try to save the file inside /usr/share/applications/pycharm.desktop. Any help regarding this would be deeply appreciated.
First start pyCharm from it's bin folder via command line
$ ./pycharm.sh
Then, goto
Tools -> Create Desktop Entry.
It will create a correct Desktop file in the correct place. Afterward you can initiate it from the menu and pin the icon or drag and drop it to the bar. This way, you don't have to deal with .desktop files and mumbo jumbo..
I managed to solve it. The thing is, Pycharm already installs a launcher inside .local/share/applications. Thus, you need to get rid of it before proceeding to create your own. After that, all you have to do is add your own *.desktop file to the applications directory inside usr/share/applications/.
You need to create your .desktop file using sudo and inside the desktop file:
[Desktop Entry]
Encoding=UTF-8
Name=PyCharm
Exec=/opt/pycharm-3.0.1/bin/pycharm.sh
Icon=/opt/pycharm-3.0.1/bin/pyCharm.png # Changed from pycharm_32.png
Type=Application
Categories=Development;
StartupWMClass=PyCharm
After that is done, you can launch your app properly. Please note that pycharm.sh must also have execution rights.
With Ubuntu 16.04, I used the "snap" installer, which doesn't include an easily accessible icon (there's probably one hidden inside the snap image, but it's hard to get at). Instead it shows a grey question mark icon in the launcher instead. Also there doesn't seem to be a Tools > Create Desktop Entry option in version 2017.3.3 as far as I can see - maybe it has been moved somewhere.
So I copied pycharm.png from an earlier non-snap Community installation, saved it somewhere, then created ~/.local/share/applications/jetbrains-pycharm-ce.desktop:
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/path/to/pycharm.png
Exec="/snap/bin/pycharm-community" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
Then when I start PyCharm (from the command line), the launcher item appears with the correct icon, and then I right-click on it and choose "Lock to Launcher", and it now persists.
A downside is that the icon will not be automatically updated with the app, so it might fall out of date.
In case you just want to update your launcher to point to an updated PyCharm, for me changing 4.0.4 to 4.0.6 in the following worked:
nano /usr/share/applications/jetbrains-pycharm.desktop
When Tools -> Create Desktop Entry does not work:
Create a new file on your desktop (using vi or a similar command) named: jetbrains-pycharm.desktop
Paste the following inside:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm
Icon=/opt/pycharm-5.0.1/bin/pycharm.png
Exec="/opt/pycharm-5.0.1/bin/pycharm.sh" %f
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm
Keep in mind to change the path and version number of icon and exec properties above.
Tested on various versions of PyCharm - like a charm ☺
In the 2016 version of PyCharm just do following:
Start PyCharm.
From the Tools menu, select "Create Desktop Entry..."
Create entry for "all the users" if required.
Relaunch PyCharm from Launcher.
Ubuntu 16.04 (haven't checked prior versions)
Run pycharm.sh (make sure you use the correct dir and PyCharm version below):
$ ./dir_where_you_placed_it/pycharm-2016.1.4/bin/pycharm.sh
While PyCharm is running, right click its icon on the Launcher and select "lock to Launcher".
Run $ pycharm-community
Right after you will see the icon on the taskbar.
Right Click, select Lock on the Taskbar.
Somewhat solves the problem.
Simply replaced the Icon=/path/to/pycharm.pngin ~/.local/share/applications/jetbrains-pycharm-ce.desktop from meowsqueak's answer with the correct path when installed from snap.
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/snap/pycharm-community/current/bin/pycharm.png
Exec="/snap/bin/pycharm-community" %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
sudo vim `which charm`
Now edit the RUN_PATH.
I recently resolved a related issue where, after updating from v2.7 to v3.0.2, my PyCharm launcher was still pointing to the old (and now deleted) PyCharm path.
After attempting all of the (good) advice above, the problem still persisted.
The solution, in my case, was to create a desktop entry for ALL USERS.
[Welcome Screen]->Configure->Create Desktop Entry...
Check the box: "Create entry for all users" and then proceed.
Apparently, in a previous installation I must have installed it in this fashion and was not able to update the launcher for a single account.
Now the pycharm updated to version 2016.1 and I find the file jetbrains-pycharm.desktop in the path ~/.local/share/applications
then just edit the path for Icon and Exec
Simply type this on your terminal window:
jetbrains-pycharm.desktop
Hope that helps :)
I just wanted to add, I just installed PyCharm Edu for Ubuntu 16.04 LTS today, and the way to create a desktop entry is very easy. When PyCharm Edu opens up, before entering any project, click on configure, and there should be a create Desktop Entry option. Select it, and it will create a PyCharm Edu.desktop file in the following directory:
/usr/local/share/applications
Now traverse to that destination, and click the newly created PyCharm Edu.desktop file to launch PyCharm Edu. After that, you would just need to lock to launcher. It should work.
I know I am very late, but I hope I've helped those of us on Ubuntu 16.04 LTS who are trying to configure a desktop entry for this specific application.
I guess you didn't check 'Create the entry for all users (requires superuser privileges)' option on Tools -> Create Desktop Entry. You should check it.
You don't have to create something new.
you can always use python for automation
may be this will help you
a python script that allows u to run pycharm as user or sudoers/root
import os
from time import sleep
sleep(1)
program = input('which program to run: >')
if program == "pycharm":
os.chdir('#full path to pycharm paste here')
root = input('run as root(y/n): >')
if root == 'y':
print('started ' + program + ' as root')
sleep(0.5)
print('please enter root password to continue:')
os.system('sudo ./pycharm.sh')
elif root == 'n':
print('running ' + program + ' as non root')
os.system('./pycharm.sh')
elif program != 'pycharm':
print('program not found')
I have an LXDE desktop (on Debian Buster) and using PyCharm CE 2020.2.3. Choosing Create Desktop Entry... created nothing on the desktop, no matter whether Create the entry for all users was checked or not.
However, the PyCharm menu entry (under Programming) offers a context menu entry Add to desktop. Clicking this finally made the desktop icon appear.

I can't find my MinGW shell after installing with GUI installer

I used Mingw_get_inst and installed the MinGW compiler suite following the instructions on the howto page. I used the GUI installer. I then changed the path to include C:\MingW; . When I go to Start menu -> all programs -> MingW the only file that exists inside of there is a uninstaller. The howto page says a shell should be there... can someone help me get this working?
Howto page on Mingw.org: http://www.mingw.org/wiki/Getting_Started
simply you could run it from the following batch file:
e.g. C:\MinGW\msys\1.0\msys.bat (if you installed your mingw in c drive)
for more info. about mysys, check this
Look at the install logs for your Mingw.
I have 2 bin dirs in my (single) installation of Mingw
C:\MinGW\msys\1.0\bin
and
C:\MinGW\bin
A lot has changed about Mingw in the last 2-3 years and I think some documentation you might find easily via google is out-of-date.
Try asking for help at mingw mail groups via Nabble (very easy to use)
IHTH
Adding the shell link is easy if you have MSYS installed.
Open your Start menu and right-click on "All Program" and choose either "Open" or "Open All Users" depending on which you want to set the shortcut for. Open the MinGW folder if it already exists, or create it (or an MSYS folder, as you wish) if it does not.
Open another Explorer window and navigate to your MSYS folder, in the default installation this is C:\MinGW\msys\1.0
Right-drag msys.bat from the MSYS explorer window to the start menu explorer window. Choose "Create shortcut" when prompted as to what you wish to do. Optionally, you may want to change the shortcut to use one of the MSYS icons from the MSYS folder.
According to older MSYS documentation, the shortcut should be set to start in the MSYS bin folder, in the default installation this is C:\MinGW\msys\1.0\bin. I'm not certain of what happens if you don't do this; the shell opens either way.
Et voilà! You now have a shell link for MSYS in your Start menu.
If you didn't have the shortcut, the other postinstall bits may not have run either. The easy way to check this is to look in C:\MinGW\msys\1.0\etc (or the appropriate path for your installation). If there is an fstab file, then the postinstall bits ran appropriately. If not, then go to C:\MinGW\msys\1.0\postinstall and run pi.bat. This will make the mingw folder available from the msys shell. Things won't work right without doing this.
Update from March 2018: The MSYS postinstall is now a Lua script, and it won't create a shortcut by default. Best I can tell, you now must do so manually in all cases.
Look for the postinstall directory, run the batch file pi.bat in there and
answer the file path questions with the correct case sensitivity.
Then gcc is found.
CNTRL-SHIFT click and drag the msys shortcut onto the desktop.
This fixes it.
Pity the installation script is broken...
Go to your windows search and go to Apps and Features and then search for it, you can find the file location and then you can probably see docs and other files :)

How does a non-admin Windows 7 user associate file types with GNU Emacs?

I have GNU Emacs 23.4 installed (or, rather, unzipped) into C:\Program Files (x86)\emacs-23.4 on my Win7 64-bit system.
It works fine except that when logged in as a non-administrative user I cannot associate files with the GNU Emacs executeables (I've tried to associate a given file type with runemacs.exe and with emacsclientw.exe). I can browse to the file in the associate dialog, but when I hit "open" it's just ignored.
It works totally fine when I'm logged in as an admin user. (And it worked fine in XP.)
I have found the following: http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/in-windows-7-how-do-i-change-the-open-with/c4a2ad7e-125c-4526-be20-c8f24f18fbfc but I'd prefer to not have to fiddle with registry entries if there's another way to accomplish this.
Any ideas?
If you had a previous version of emacs installed then windows will have associated the name emacsclientw.exe and runemacs.exe with the older version path. To successfully use a new version of emacs you have to remove those associations from the registry with regedit.exe.
Remove the entries:
HKEY_CLASSES_ROOT\Applications\emacsclientw.exe
HKEY_CLASSES_ROOT\Applications\runemacs.exe
Please also see
http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-do-i-remove-programs-from-the-other-programs/73a34fc6-b968-429f-9e5e-a0873d67eed9?msgId=1946ffef-cf76-49c6-adb8-0850e1c8610d
I've had the same problem and I've found that the registry entry has to be
emacs-path\bin\emacsclientw -n "%1"
After many attempts to make the GNU Emacs Windows build work to my satisfaction, I always come back to the patched EmacsW32 build. Among other things, it provides an installer that adds file associations and other shell extensions. I've found that it always handles the "Open With" problem correctly. Unfortunately, the latest patched build is of Emacs 23.1.
Same problem trying to associate Allegro Free Physical Viewer rev 16.6 to .brd files.
It turns out that the registry key had the wrong path to the application. I ran regedit navigated to:
HKEY_CLASSES_ROOT > Applications > allegro_free_viewer > shell > open > command
copied out the path and tried that in a CMD window and got path not found (bad path).
I navigated a explore window to the path of the application and copied that path into the registry "command" value, closed regedit, and it worked.

Resources