Skip to content

Commit

Permalink
Windows: Setup-compatible launcher + .iss file
Browse files Browse the repository at this point in the history
The launcher must download files to $GPODDER_HOME,
otherwise it won't be able to save files in the
application folder when installed using the setup.
  • Loading branch information
thp committed Nov 7, 2011
1 parent 30f3539 commit b005c2a
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 5 deletions.
Binary file modified tools/win32-launcher/gpo.exe
Binary file not shown.
15 changes: 10 additions & 5 deletions tools/win32-launcher/gpodder.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ int main(int argc, char** argv)
int _argc = 1;
char *_argv[] = { MAIN_MODULE };
TCHAR gPodder_Home[MAX_PATH];
TCHAR Temp_Download_Filename[MAX_PATH];

HMODULE python_dll;
FARPROC Py_Initialize;
Expand All @@ -95,7 +96,7 @@ int main(int argc, char** argv)
BAILOUT("Cannot determine your home directory (SHGetFolderPath).");
}

strncat(gPodder_Home, "\\gPodder", MAX_PATH);
strncat(gPodder_Home, "\\gPodder\\", MAX_PATH);
if (SetEnvironmentVariable("GPODDER_HOME", gPodder_Home) == 0) {
BAILOUT("SetEnvironmentVariable for GPODDER_HOME failed.");
}
Expand Down Expand Up @@ -124,12 +125,14 @@ int main(int argc, char** argv)
"Do you want to install it now?",
"Python 2.7 installation not found",
MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (DownloadFile(PYTHON_INSTALLER_FILE,
strncpy(Temp_Download_Filename, gPodder_Home, MAX_PATH);
strncat(Temp_Download_Filename, PYTHON_INSTALLER_FILE, MAX_PATH);
if (DownloadFile(Temp_Download_Filename,
PYTHON_INSTALLER_URL,
PYTHON_INSTALLER_SIZE) == PYTHON_INSTALLER_SIZE) {
ShellExecute(NULL,
"open",
PYTHON_INSTALLER_FILE,
Temp_Download_Filename,
NULL,
NULL,
SW_SHOWNORMAL);
Expand Down Expand Up @@ -160,12 +163,14 @@ int main(int argc, char** argv)
"Do you want to install it now?",
"PyGTK installation not found",
MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (DownloadFile(PYGTK_INSTALLER_FILE,
strncpy(Temp_Download_Filename, gPodder_Home, MAX_PATH);
strncat(Temp_Download_Filename, PYGTK_INSTALLER_FILE, MAX_PATH);
if (DownloadFile(Temp_Download_Filename,
PYGTK_INSTALLER_URL,
PYGTK_INSTALLER_SIZE) == PYGTK_INSTALLER_SIZE) {
ShellExecute(NULL,
"open",
PYGTK_INSTALLER_FILE,
Temp_Download_Filename,
NULL,
NULL,
SW_SHOWNORMAL);
Expand Down
Binary file modified tools/win32-launcher/gpodder.exe
Binary file not shown.
54 changes: 54 additions & 0 deletions tools/win32-setup/gpodder-setup.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{ABE123A1-41D1-4917-8E1E-C7E37991B673}
AppName=gPodder
AppVersion=3.0.0
;AppVerName=gPodder 3.0.0
AppPublisher=Thomas Perl
AppPublisherURL=http://gpodder.org/
AppSupportURL=http://gpodder.org/
AppUpdatesURL=http://gpodder.org/
DefaultDirName={pf}\gPodder
DefaultGroupName=gPodder
LicenseFile=C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\COPYING
InfoBeforeFile=C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\README
OutputDir=C:\Dokumente und Einstellungen\thp\Desktop\x
OutputBaseFilename=gpodder-3.0.0-setup
Compression=lzma
SolidCompression=yes
WizardSmallImageFile=C:\Dokumente und Einstellungen\thp\Desktop\x\wizard-small-image.bmp
WizardImageFile=C:\Dokumente und Einstellungen\thp\Desktop\x\wizard-image.bmp

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\gpodder.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\COPYING"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\gpo.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\README"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\bin\*"; DestDir: "{app}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Dokumente und Einstellungen\thp\Desktop\x\gpodder-3.0.0-win32\src\*"; DestDir: "{app}\src"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\gPodder"; Filename: "{app}\gpodder.exe"
Name: "{group}\gPodder (CLI)"; Filename: "{app}\gpo.exe"
Name: "{group}\{cm:ProgramOnTheWeb,gPodder}"; Filename: "http://gpodder.org/"
Name: "{group}\{cm:UninstallProgram,gPodder}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\gPodder"; Filename: "{app}\gpodder.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\gPodder"; Filename: "{app}\gpodder.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\gpodder.exe"; Description: "{cm:LaunchProgram,gPodder}"; Flags: nowait postinstall skipifsilent

Binary file added tools/win32-setup/wizard-image.bmp
Binary file not shown.
Binary file added tools/win32-setup/wizard-small-image.bmp
Binary file not shown.

0 comments on commit b005c2a

Please sign in to comment.