The forum

Scripting doubts

Author Replies
Disabled account Friday 10 January 2014 at 0:35
Disabled account

Hello,
I am a playonlinux user for a long time.
Played lots of games, some categorized as garbage in winehq at the time.
So I though I could start making some scripts and help people, but wanted to start with a default installation script for the new games that are released. And make my default configurations + overrides I normally use.
I read all the script documentation and it was so well made I learn in a few minutes how to use it. But then I felt 2 things missing and I would like to know if it exists or if its possible to add to the scripting.

Those things are:
  • Select latest wine version (non-patched is the best choice in my opinion)
  • Open the shorcut prompt that is in the configuration
  • List prefixes for selection

Like to thank all PoL team for making me play games on linux for so long... :)

And sorry if I wrote something wrong



Edited by Disabled account

Ronin DUSETTE Friday 10 January 2014 at 4:26
Ronin DUSETTE

Thats not always a good idea, to use a "generic" type script. A lot of things require different versions of different things.

For instance, if you havea script that uses wine 1.7, and that script adds, say, .NET, it will break things. Why? Because Wine 1.7 comes with wine-mono, which is an open-source implementation.

What I usually do, is have a Virtual Drive set up with the most current things I can. wine-mono, latest stable version of wine, 32 bit, all vcrun20** packages, and dx3d9. With this virtual drive, I can usually install a good chunk of games right into the same virtual drive with no problem. Off the top of my head, I have about 5 apps all in the same virtual drive, so it is possible.

Wine is starting to mature to the point where, unfortunately (and kind of fortunately in a sad/happy way), we will be able to have a great Wine install that doesnt need any scripts to install dependencies. This is still a ways off, but its getting there. haha.

Those things are a bit like winetricks. You can do all of that via BASH scripting, but why you would want to list prefixes doesnt make sense. If you want this script to do what you are thinking, then you would need to have it always create a new virtual drive with a new name (using variables as much as possible), OR, create the virtual drive, and simply run the installer in that drive via:

PlayOnLinux -> Configure -> select your virtual drive -> Misc tab -> Run a ".exe" in this virtual drive

That will run your installer in the context of that virtual drive (aka a WINEPREFIX).

Hope this helps :)

Start reading through the source code for the scripts in the supported software section. The League of Legends one is a good one to check out. If you want to see more BASH, the FUNCTIONS section of supported software is where that is at. Studying source code will get you more familiar with how it works, especially once you write some scripts.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Disabled account Friday 10 January 2014 at 9:46
Disabled account

I know that lot of things require different things.
I always create one prefix for each game.
but
that is why I want to list my prefixes. so i can choose the one i want to update. I know how to use the PoL very well and how to run exe on
the prefix including on the script. the thing here is that fixing the
prefix name on an update script is a little bad. example if you do the
installation script. and i do a script for an update like installing a
patch or fixing a common bug between apps (like missing overrides), if you change your prefix name i have to change also my script
prefix name. thats kinda weird. also the user can change their prefix
names. what i want is simply for the user to chose the prefix he will run the
script on.

In the case of the recent wine version its
because i do a lot of testing and I play a lot of recent games or closed
betas (check infinite crisis on winehq i put the test there) so i
always use the most recent prefix unless it doest work in there. So the
only available option in the script instead of using a fixed version is
using the system version and that defers a lot from the distributions.

do you know something about the shortcut selection? can i call that gui in the scripting after the installation of the game? The function is not in the manual.

I will check the scripts, thanks for your help...


Edited by Disabled account

Ronin DUSETTE Friday 10 January 2014 at 10:07
Ronin DUSETTE

Oh. haha. You didnt write anything wrong. If Im curt, its because I just type fast and tend to be a smart-ass from time to time. :) Not to mention its very late in the states and Im up working on a project. lol. Dont sweat it at all. Wine/POL can get pretty hairy when it comes to manipulating the WINEPREFIX's. 

They are listed. Well, you shouldnt need to do that if you script is written correctly.

You shouldnt need to fix bugs between apps, because they are all separate. If they were installed correctly in the first place, you dont need it.

We dont change the PREFIX variable in scripts unless needed, so dont worry about that. Its not weird. Its simply the order of operations.

The user cannot change their scripts in the official repo once signed, unless myself or another dev signs off on it, and they logically explain why they made the change.

You put the prefix in the script. Period. If that feature werent* there, it would be a nightmare, and the main problem, which POL tries to solve, is separate environments for EACH app and wine install, all with its own ENV variables.

Using the most recent wine is not always the best version. You can always change it. You can go to tools and Manage Wine Versions. If you spend this much time testing them, then you must be familiar with [url]http://appdb.winehq.org[/url] ? You can research others experiments with different versions. If you need a different one, then install it through the Tools menu in POL, and then:

PlayOnLinux -> Configure -> select virtual drive -> select your Wine version from Wine Versions.

That is already there. Its in the docs, too, if I am not mistaken.

So is the shortcut function.... [url]http://www.playonmac.com/en/dev-documentation-11.html[/url]

I suggest doing a lot more reading and scripting before criticizing so much. hahaha. Everything you are not liking, is either moot, bad practice, or already there.

Again, I want reiterate that, what you want to do with running the same script on the some arbitrary prefix without deleting between installs and recreating the prefix will probably cause more harm than good. Trust me.

To recap:


I always create one prefix for each game.
but that is why I want to list my prefixes.

Quote


Its in the configure tab. PREFIX variables are hardcoded in the scripts for many reasons. We have backend stuff that uses it, as well as it keeps everything separated, like two scripts having the same prefix.


example if you do the installation script. and i do a script for an update like installing a patch or fixing a common bug between apps (like missing overrides), if you change your prefix name i have to change also my script prefix name. thats kinda weird.

Quote


That is exactly one of the reasons it is how it is. We have bug tracking for that and other stuffs for that.


also the user can change their prefix names. what i want is simply for the user to chose the prefix he will run the script on.

Quote


No, they cannot. They have to be signed by us. Users do not have write/mod access to our repo. Again, dont worry about that.


In the case of the recent wine version its because i do a lot of testing and I play a lot of recent games or closed betas (check infinite crisis on winehq i put the test there) so i always use the most recent prefix unless it doest work in there. So the only available option in the script instead of using a fixed version is using the system version and that defers a lot from the distributions.

Quote


This is not true, covered in the docs, and, if POL were properly explored via its menus, you would see the option to install whatever version of wine that you want, and then you can arbitrarily pick on from a dropdown menu in the first tab of the Configure window, after selecting your virtual drive (aka prefix) on the left. You can change these back and forth usually without breaking the prefix.


do you know something about the shortcut selection? can i call that gui in the scripting after the installation of the game? The function is not in the manual.

Quote


Refer to the link to the manual above.

Also, the word "prefix" is NOT the name for the version of Wine. Please read Wine's docs, as it will explain it fairly well. When you are speaking about wine versions, just say that, when using "prefix", most would assume your referring to a WINEPREFIX, which is where your app is installed. There is quite a difference in nomenclature. 

Edited by RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Ronin DUSETTE Friday 10 January 2014 at 10:20
Ronin DUSETTE

One more thing. lol

Select latest wine version (non-patched is the best choice in my opinion)

Quote


Its not always. Think about this; if we set a script to use the newest, un-patched wine, and now the install fails, we are still going to have to backtrack, and pick the best-suited wine version for that particular application, along with the specific dependencies. Regressions happen fairly often as things upgrade (just look at Steam's upgrade and issues with Wine recently). Just food for thought.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Disabled account Friday 10 January 2014 at 15:08
Disabled account

Ok. I think i'm not explaining what i wanted to know very well.
let me see if I can explain my doubts better.

first some of these things that im talking in scripting its for people that like to check the newest wineversions and teste recent released games with it, its not to do the game script. (probably after testing the gamescript can be done)
I just want to know if those options exist or not.
the part about the list of prefix i asked because you have scripts that installs patchs on a previous installed game, so the person o does the game script has to be the same the does the patch script?
its has to be the same prefix fixed on both scripts?
if i installed manually and have difficulty in installing the patch the patch script cant work? this are my doubts regarding the choice of prefix,just wanted to know if it existed the option.
if i want to make the patch install in the game i edit the installation script to install it or do a new one to patch the existing prefix?
about the shortcuts what i wanted was to know if its was possible to open the option that is on the configuration -> make shortcut to select a exe, but via script. because there is no command to open that menu in the manual that opens that menu so i dont know if it exists or not...
or its just a file search of "*.exe" and a normal pol menu with the listed files?

Sorry if i criticizing so much that was not the intention. probably this options dont exist or dont make sense for the PoL, because you want to centralize all scripts, each for its game, and probably my default installation script cant be done with what i wanted to do...

Thank you for your time and patience

kind regards


Edited by Disabled account

Ronin DUSETTE Friday 10 January 2014 at 17:20
Ronin DUSETTE

Everything you want to do, is either moot, been done, or is already there. You are explaining it just fine, hence my long-winded response. You are obviously new to scripting (no offense. seriously.) and dont understand it well enough to get why its like that. Ill try again.

first some of these things that im talking in scripting its for people that like to check the newest wineversions and teste recent released games with it, its not to do the game script. (probably after testing the gamescript can be done)

Quote


This is exactly why there are options to do a manual installation. So you CAN do that. Also, if you already have something installed, you can just install another wine version, and use it in that wineprefix (virtual drive). My instructions above state exactly how to do so.

the part about the list of prefix i asked because you have scripts that installs patchs on a previous installed game, so the person o does the game script has to be the same the does the patch script?

Quote


No, but obviously, the person writing the patch would need to use the same PREFIX variable that is set for that particular game they are patching, otherwise it will create another new prefix.

if i installed manually and have difficulty in installing the patch the patch script cant work? this are my doubts regarding the choice of prefix,just wanted to know if it existed the option.

Quote


..... You cannot patch something in another prefix. Plus, seriously, edit the dang script and change the variable to test it. Right-click, open with your favorite editor, and save.

if i want to make the patch install in the game i edit the installation script to install it or do a new one to patch the existing prefix?

Quote


It depends on what you need to do, and how much of the original you can reuse. Obviously, you have to reuse the PREFIX and possibly wine versions, but its such a small and fast edit, that it really shouldnt be a problem. Plus, we make sure that the script has tested to work correctly before it gets signed to be added or modified in the repo.

about the shortcuts what i wanted was to know if its was possible to open the option that is on the configuration -> make shortcut to select a exe, but via script. because there is no command to open that menu in the manual that opens that menu so i dont know if it exists or not...

Quote


Dude... I explained that at great length, and even gave you a link to the command (its where you said it wasnt). If you dont know HOW to use the command, you simply need a better understanding and more practice with scripting. Again, not offensively, but you are simply not getting it, or not reading my posts completely.

Sorry if i criticizing so much that was not the intention. probably this options dont exist or dont make sense for the PoL, because you want to centralize all scripts, each for its game, and probably my default installation script cant be done with what i wanted to do...

Quote


So, as stated before, the options you want are either useless or already there. There is no reason to create a default install script. This is why we provide documentation on scripting; so that others can learn, write their own scripts, run their own scripts without having them on our repo, and when they are up to par, they can submit them for approval. "A default install script" goes against what this program does. You might as well just use the regular system-wide wine command, without POL, as all you have to is update your system, and there is a new version of wine.

But even then, you can install a new version of wine WITHIN POL. I suggest not worrying too much about a default install script, and just create a virtual drive with all of the default dependencies that you want installed, and as new versions of wine come out, you can install them like I said above. As they come out, they are built and added automatically by our sever. Again, this was all stated above. :)

I also suggest re-reading the documentation on scripting and just start writing scripts. If you really want to understand how to do it, you need to understand BASH. Start there. :D

No problem. Tis why we are here. :)

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Disabled account Friday 10 January 2014 at 20:10
Disabled account

Your not understanding the questions, but its fine I get it.

This is exactly why there are options to do a manual installation. So
you CAN do that. Also, if you already have something installed, you can
just install another wine version, and use it in that wineprefix
(virtual drive). My instructions above state exactly how to do so.

Quote from DJYoshaBYD


I know that there is. I install all my games manually and I have played lots and lots of games what I asked you was if its was possible via script. I get it..

for all the patching questions, thanks just wanted to now how its commonly done.
as for the prefix choice, just wanted to know if it was possible.


Dude... I explained that at great length, and even gave you a link to
the command (its where you said it wasnt). If you dont know HOW to use
the command, you simply need a better understanding and more practice
with scripting. Again, not offensively, but you are simply not getting
it, or not reading my posts completely.

Quote from DJYoshaBYD


has for the shortcut, when manually installing the game, after that when you are creating manually a shortcut this GUI appears:



this is the screen I wanted to know if its was possible to open via script.

i know how the POL_Shortcut works. So for your response i asume its not possible to open this GUI in the script with one single command (since its a POL_SetupWindow_MENU).



So, as stated before, the options you want are either useless or already
there. There is no reason to create a default install script. This is
why we provide documentation on scripting; so that others can learn,
write their own scripts, run their own scripts without having them on
our repo, and when they are up to par, they can submit them for
approval. "A default install script" goes against what this program
does. You might as well just use the regular system-wide wine command,
without POL, as all you have to is update your system, and there is a
new version of wine.

Quote from DJYoshaBYD


I know you to use POL with the GUI I just wanted to know if it existed in the scripting some options if they are not needed for the POL purpose its ok I get it, when someone does not know how its done its common to ask, i think.

sorry if it offended you in any way. Just said what I thought and asked...

No need to worry about my default script.

I will mark this tread as solved.


so to finish and for the others to know,

in the POL scripting is it possible with one single command to:

  • Select latest wine version (non-patched is the best choice in my opinion)  = NO
  • Open the shorcut prompt that is in the configuration = NO
  • List prefixes for selection = NO

Thanks and sorry if I took your time.


Edited by Disabled account

Ronin DUSETTE Friday 10 January 2014 at 20:35
Ronin DUSETTE

I dont know what to tell you, dude. This isnt winetricks, and does not have the same features.


Select latest wine version (non-patched is the best choice in my opinion) = NO

Quote


I have already explained why this is NOT the best choice, and how you can do it yourself, SO simply, right in PlayOnLinux. Again:

PlayOnLinux -> tools -> manage wine versions -> install the one you want to use -> and either do your manual install AFTER installing the wine version you want, OR change it on the first tab in the configure window.

This IS possible to do via script... You just dont know BASH. lol.


Open the shorcut prompt that is in the configuration = NO

Quote


I see what you are saying now. Again, because you are still a beginner to scripting, you werent really explaining it clearly. Although, I dont know why, if you are doing manual installs anyway (by manual install, I DONT mean the setup wizard. I mean manually creating every part), why you cant just use the setup menu.

This is very easily accomplished inside of a script, but that doesnt make sense.. Why, if you are doing manual installs, do you want to make this shortcut window pop up? If the script is written correctly, it will pick the right one.

If you REALLY want to see where all of the functions that POL has are, go here and study the source:

[url]https://github.com/PlayOnLinux/POL-POM-4[/url]

This what I found. Quite quickly.

In the manual install script, it calls:

[code]POL_SetupWindow_shortcut_creator[/code]

NOTE**: You cant (I dont think) instantiate this function without instantiating the SetupWindow, as documented in the scripting manual. I forget which one exactly need to come first, but you have to start the POL_SetupWindow, THEN you can do other stuff within its context, then you have to make sure that you close POL_SetupWindow. I dont know it off the top of myhead, but that should point you in the right direction. 

This would be what you would use in your script. Again, I dont think this is a good idea and not worth the effort, but hey, its your time.


List prefixes for selection = NO

Quote



Your not understanding the questions, but its fine I get it.

Quote


I simply think you dont understand WHY you are asking these questions, as I have told you reasons not to and all of that...

You didnt offend me. Not at all. Its just hard to get it all across, and I type about 100 WPM (literally not a joke), so I can fill a lot of space. haha. I just wanted to make sure that I explained it as thoroughly as possible.

As for a list of preset selections, your BEST choice is to install the newest version of Wine into POL, and set it using wine version dropdown (this CAN be done using a script, but you DO have to edit the script). If the script is written correctly, you can use conditional statements ("if", "else", etc.) and wildcards to make sure that the script picks up the newest version of wine, if it detects one.

Im telling you; if you learn BASH pretty well (its so not hard. The advanced stuff is, but you can get it quick), then conditional statements and wildcards should be able to fill this gap.

For instance, the Ableton Live 8 script wanted to create a shortcut for a file called "Live 8.2.2.exe". Problem is, that script works for all Ableton Live 8 versions, so instead of doing it like that, in the script, I changed it to "Live 8.*.exe". The asterisk means anything that is here is a match (just FYI if you didnt know what a wildcard is). So, now, it will pick out the correct executable, no matter what the subversion number.

Of course, with scripting and programming, there seems to always be more than one way to skin a cat, so to speak. "The 'right way', the 'wrong way', and the 'best way'. lol

Also, always remember, this project is open source. That link that I sent you has the code for PlayOnLinux, so you can always go through there. Truth be told, I learned just as much from studying source as I did from reading tutorials. hahaha.

Hope this helps. Sorry I couldnt give you the answer you were looking for.

Edited by RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Ronin DUSETTE Friday 10 January 2014 at 21:05
Ronin DUSETTE

Merry Xmas, sir. :)

I went through the source, and I found some stuff that may help you along.

(NOTE: These have to be run in this order. The docs have more info on that)


#This starts the window (if you are running a script, this NEEDS to start,#otherwiseitwont work. Thats for every script.)
POL_SetupWindow_Init


#This will launch the prefix selector so that you can select a virtual drive/prefix

POL_SetupWindow_prefix_selector


#This will let you choose the shortcuts, or even browse for one in that prefix

POL_SetupWindow_shortcut_creator



Hope this helps a bit more. I found this by looking through the source, and also opening up a shell from POL and typing in POL_ and hitting 'tab' to get it to show my what it can autocomplete to.

Edited by RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Disabled account Saturday 11 January 2014 at 15:48
Disabled account

thanks a lot. that was what i was looking for.
I know that the scripting target is one game only.
but the script i want is for testing games with the latest wineversion with my normal configs.(also wanted to test what can be done with the scripting).
And its not for me. It is probably faster to do it manually...

now some of my friends (some don’t even play games) can now test some games with me and probably after that I can do more game scripts like its normally done.
Its really my first time with the bash but I’m a dev. so in time I will get better. :)

Thanks a lot for the Xmas present.lool
Hope to send presents(game scripts) soon
Hugs


Edited by Disabled account

Ronin DUSETTE Saturday 11 January 2014 at 17:31
Ronin DUSETTE

haha. no problem. What language do you dev with?

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Disabled account Saturday 11 January 2014 at 18:43
Disabled account

haha. no problem. What language do you dev with?

Quote from DJYoshaBYD


My main Lang is C#, in work is for win native. in home i use mono and mono-game (its like a copy of xna but cross-platform).
But i have tryed java, javascript, html5 with canvas ,vb(learned from school).

I'm always exited to learn new thing's but i keep going back to C#. probably because its what i use in work (and because i love Linq.lol)...

Edited by Disabled account

Ronin DUSETTE Saturday 11 January 2014 at 18:51
Ronin DUSETTE

Ah, word. I was looking into that, but personally, I want nothing to do with anything that is used or developed by Microsoft. I avoid it like the plague. lol.

Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com