qmasingarbe / pymiere

Python for Premiere pro
GNU General Public License v3.0
363 stars 46 forks source link

Super-easy installation #27

Closed PFython closed 3 years ago

PFython commented 3 years ago

Feature Request:

Hi Quentin, I hope you've seen and will approve my recent Pull Request to make Pymiereinstallable via pipsoon. In the spirit of making software super-easy to install, and possibly make Pymiereattractive to end users as well as developers, is there any way we could automate the download and installation of Adobe's Extension Manager Command Line tool and pymiere_link.zxp?

I see there's at least one .bat file in Pymierealready which gives me hope you might have the skills to do this, particularly as we're only looking at Windows 10 installation currently!

1) When Pymiereis opened, check if the extension is already installed (maybe create a micro config file after installation, unless there's a more elegant/fast way to 'detect' the extension exists?).

If not installed:

2) Download directly from http://www.adobe.com/go/ExManCmdWin 3) Download from https://github.com/qmasingarbe/pymiere/blob/master/pymiere_link.zxp

Both files presumably default to user's home/downloads folder, you could use very quick and simple PySimpleGui popups to confirm location (I can provide, if you're not familiar with PySimpleGui yet... though the learning curve is amazingly fast!).

4) Run .\ExManCmd.exe /install D:\path_to_extension\pymiere_link.zxp as .bat or directly from Python (e.g os.system('cmd ...'). Since this is being done programmatically presumably we can use the full absolute paths rather than having to set PATH?

If you need popups for any user confirmations I can easily provide those too.

All the best, Peter

b-a0 commented 3 years ago

I think having an "auto-installer" is a nice idea. I've put together a first draft for steps 2,3 and 4 (for a Mac), perhaps it's helpful.

#!/usr/bin/env bash
# Get current path
cwd=$(pwd)

# Download zxp file, get name and path
echo "Download .zxp file"
url="https://github.com/qmasingarbe/pymiere/blob/master/pymiere_link.zxp"
curl -O "$url"
fname_zxp=$(basename "$url")
path_zxp="$cwd/$fname_zxp"

# Download ExManCmd, get name and path
echo "Download ExManCmd"
url="https://download.macromedia.com/pub/extensionmanager/ExManCmd_mac.dmg"
curl -O "$url"
fname_exman=$(basename "$url")
path_exman="$cwd/$fname_exman"

# Mount ExManCmd DMG
echo "Mount ExManCmd DMG: $path_exman"
hdiutil attach "$path_exman"

# TODO: this is ugly, the path to the mounted volume should not be hardcoded,
# but determined automagically.
volname="/Volumes/cmdline64"
exmancmd="$volname/Contents/MacOS/ExManCmd"

# Install the .zxp file
echo "Install zxp"
"$exmancmd" --install "$path_zxp"
# For debugging
# "$exmancmd" --list all

# Clean up
echo "Unmount ExManCmd DMG"
hdiutil detach "$volname"
qmasingarbe commented 3 years ago

Hi guys, I managed to pull something together (https://github.com/qmasingarbe/pymiere/commit/0cf687fb413e7239bbf6e055cd758c90b10d35e1). Thank you @b-a0 for doing most of the work on mac! I only made minor improvments. @PFython Thank you for the suggestion, although I will not automatically install the extension if not found and let the user decide.

PFython commented 3 years ago

Fantastic! Looking forward to having a look Quentin.... All the best.