Code::Blocks

Informations

Creator Message
FuzzyToothpaste Anonymous

Warning

This installer has not been approved yet by the team.

Informations

Platforms:
Downloads: 0
Wine: System

Feedbacks

Description

Code::Blocks is a free and open-source C++ and Fortran IDE. This script is intended to install the Windows version. Downloading Code::Blocks will also install Windows compilers.

Source code

                

Contributions

Filters:

Contribute
Member Message
FuzzyToothpaste Sunday 26 April 2015 at 1:25
FuzzyToothpaste Anonymous

Warning

This update has not been approved yet by the team.
Use it at your own risk

Differences

@@ -0,0 +1,40 @@
+#!/usr/bin/env playonlinux-bash
+# Date : (2015-04-25)
+# Last revision : (2015-04-25)
+# Wine version used : 1.7.41-staging
+# Distribution used to test : Kubuntu 14.04 LTS 
+# Author : FuzzyToothpaste
+
+[ "$PLAYONLINUX" = "" ] && exit 0
+source "$PLAYONLINUX/lib/sources"
+
+TITLE="Code::Blocks"
+POL_SetupWindow_Init
+ 
+
+POL_SetupWindow_presentation "$TITLE" "Code::Blocks Developers" "http://www.codeblocks.org" "FuzzyToothpaste" "CodeBlocks"
+
+
+POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"
+POL_System_TmpCreate "CodeBlocksTmp"
+cd "$POL_System_TmpDir"
+if [ "$INSTALL_METHOD" = "LOCAL" ]
+then
+        POL_SetupWindow_browse "Please select the installation file to run." "$TITLE installation"
+        INSTALLER="$APP_ANSWER"
+elif [ "$INSTALL_METHOD" = "DOWNLOAD" ]
+then
+        POL_Download "http://iweb.dl.sourceforge.net/project/codeblocks/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe" "58c1120e35f306d4903c0113740c31e3"
+        INSTALLER="$POL_System_TmpDir/codeblocks-13.12mingw-setup.exe"
+fi
+
+POL_Wine_SelectPrefix "CodeBlocks"
+POL_Wine_PrefixCreate "1.7.41-staging"
+Set_OS "win81"
+POL_SetupWindow_wait "Please wait" "Installation in progress"
+POL_Wine "$INSTALLER"
+POL_Shortcut "codeblocks.exe" "$TITLE"
+POL_System_TmpDelete
+
+POL_SetupWindow_Close
+exit

New source code

#!/usr/bin/env playonlinux-bash
# Date : (2015-04-25)
# Last revision : (2015-04-25)
# Wine version used : 1.7.41-staging
# Distribution used to test : Kubuntu 14.04 LTS 
# Author : FuzzyToothpaste

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TITLE="Code::Blocks"
POL_SetupWindow_Init
 

POL_SetupWindow_presentation "$TITLE" "Code::Blocks Developers" "http://www.codeblocks.org" "FuzzyToothpaste" "CodeBlocks"


POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"
POL_System_TmpCreate "CodeBlocksTmp"
cd "$POL_System_TmpDir"
if [ "$INSTALL_METHOD" = "LOCAL" ]
then
        POL_SetupWindow_browse "Please select the installation file to run." "$TITLE installation"
        INSTALLER="$APP_ANSWER"
elif [ "$INSTALL_METHOD" = "DOWNLOAD" ]
then
        POL_Download "http://iweb.dl.sourceforge.net/project/codeblocks/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe" "58c1120e35f306d4903c0113740c31e3"
        INSTALLER="$POL_System_TmpDir/codeblocks-13.12mingw-setup.exe"
fi

POL_Wine_SelectPrefix "CodeBlocks"
POL_Wine_PrefixCreate "1.7.41-staging"
Set_OS "win81"
POL_SetupWindow_wait "Please wait" "Installation in progress"
POL_Wine "$INSTALLER"
POL_Shortcut "codeblocks.exe" "$TITLE"
POL_System_TmpDelete

POL_SetupWindow_Close
exit

Replies

Sunday 26 April 2015 at 8:47
Hi FuzzyToothpaste,
my review:
- You can add POL_SetupWindow_SetID 2507 after POL_SetupWindow_Init, it'll add an icon to the installation wizard leading to this very page;
- More importantly, you forgot to add POL_Debug_Init just below. It's not mentionned in the "Mozilla" example script, since it's introduced a bit later in the tutorial, but it's really mandatory for new scripts;
- POL_SetupWindow_browse "Please select the installation file to run." "$TITLE installation"
All user-oriented messages need localization support. Same thing, it's introduced somewhat later in the tutorial http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_10:_Script_Translation
- POL_SetupWindow_wait "Please wait" "Installation in progress"
Use POL_Wine_WaitExit "$TITLE" instead, it will display the default waiting message and save you the trouble of another user-oriented message to translate
That's it for the script itself. Does this program really require Wine 1.7.41-staging to run? Otherwise I'd recommend to stick to stable Wine versions (1.6.2 those days), for stability but also to try to standardize the scripts on fewer Wine versions. The problem with always using the latest/greatest version available is that in a week or two it'll be another version.
That's it for me,
Regards, Pierre
Monday 27 April 2015 at 20:27
I also wanted to mention that for Wine versions and things like that, it is generally standard practice to declare variables at the top (like a WINEVERSION variable, etc). It makes it easier to maintain in the future, especially if you need to use something more than once in the script. Not necessarily required, but is good practice nonetheless. :D