I've created an automated install script for minecraft (It doesn't pirate the game, it just downloads the dmg, mounts the dmg and copies the app to /Applications) and when the launcher starts it thinks its running off the dmg file and won't open.
The Script:
!#/bin/zsh
cd Downloads
echo This script will install Minecraft on your computer, you need administrative privileges to do this
echo "Do you wish to install Minecraft?"
select yn in "Yes" "No"; do
case $yn in
Yes ) curl -O https://launcher.mojang.com/download/Minecraft.dmg
hdiutil attach Minecraft.dmg -quiet
sudo cp -r /Volumes/Minecraft/Minecraft.app /Applications
hdiutil detach /Volumes/Minecraft
break;;
No ) exit;;
esac
done
This isn't a supported installation method. Since the application works when installed the normal way, I'm afraid it's up to you to figure out what your script is doing differently.
As a side note, why would you need or want an installation script? The Launcher updates itself.