Author Topic: create installer for OpenMPT  (Read 4124 times)

Offline jmichae3

  • Shy artist
  • Posts: 5
    • http://JesusnJim.com
create installer for OpenMPT
« on: January 01, 2010, 05:15:53 »
I would suggest using NSIS for an installer since it is scriptable and looks like assembler, except with functions and sections and section groups.

here is the code for one of my installers (pwdgen - it is GPL3 code if you want to modify and use it).  Mostly what is needed is a search and replace of "pwdgen" with "OpenMPT".  

you will also need to search and replace "1.7" with whatever version you happen to be using.  you will also need to change the registry entries for the program version number farther down around the middle.

it uses the NSIS Files command to archive/compress the files in the current directory and subdirectories into the setup executable, but I use the /x option to exclude the setup file itself, which you will have to name approrpriately.  So you should move the setup.nsi file (this file) to the same directory as your files' root.

zip files are so hard to deal with. but if someone wants source, it's the easiest way to distribute I've found - much easier than using the installer to distribute the source.

Code: [Select]
/*
Copyright 2009 Jim Michaels, Joost Verburg
This file is part of pwdgen.

    pwdgen is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    pwdgen is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with pwdgen.  If not, see <http://www.gnu.org/licenses/>.

*/
;NSIS Modern User Interface
;Start Menu Folder Selection Example Script
;Written by Joost Verburg
;mostly modified by Jim Michaels June 28-29, 2009

;--------------------------------
;Include Modern UI
RequestExecutionLevel admin  ;gotta do this to have uninstallation it seems, required for HKLM access
!include "MUI2.nsh"
!include "x64.nsh"



;--------------------------------
;General

  ;Name and file
  Name "pwdgen Password Generator"
  OutFile "pwdgen-1.7-setup.exe"

  ;Default installation folder
;  InstallDir "$LOCALAPPDATA\pwdgen"
  InstallDir "$PROGRAMFILES\pwdgen"
 
  ;Get installation folder from registry if available
  InstallDirRegKey HKCU "Software\pwdgen" ""

  ;Request application privileges for Windows Vista
  RequestExecutionLevel admin

;--------------------------------
;Variables

  Var StartMenuFolder

;--------------------------------
;Interface Settings

  !define MUI_ABORTWARNING
Function .onInit
    #prevent multiple instances of the installer running
    System::Call 'kernel32::CreateMutexA(i 0, i 0, t "pwdgen-setup") i .r1 ?e'
    Pop $R0

    StrCmp $R0 0 +3
    MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
    Abort

;    SetOutPath "."
;    File /oname=$PLUGINSDIR\welcome.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
;  File "setup.ini"
GetDlgItem $0 $HWNDPARENT 1
CreateFont $1 "$(^Font)" "14" "700"
;culprit. worked in older versions.  what do I do now?  got this from the forums.
;    CreateFont $HEADLINE_FONT "$(^Font)" "14" "700"
    InitPluginsDir
;    SetOutPath "$PLUGINSDIR"
    SetOutPath "$PROGRAMFILES\pwdgen"



SetShellVarContext all

FunctionEnd


;--------------------------------
;Pages

  !insertmacro MUI_PAGE_WELCOME
;  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
  !insertmacro MUI_PAGE_LICENSE "gpl.txt"
  !insertmacro MUI_PAGE_COMPONENTS
  !insertmacro MUI_PAGE_DIRECTORY
 
  ;Start Menu Folder Page Configuration
  !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
  !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Jim Michaels\pwdgen"
  !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
 
  !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
 
  !insertmacro MUI_PAGE_INSTFILES
  !insertmacro MUI_PAGE_FINISH
 
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

;--------------------------------
;Languages
 
  !insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "-Dummy Section" SecDummy
File /r /x pwdgen-1.7-setup.exe *.* ;goes to

  SetOutPath "$INSTDIR"
 
  ;ADD YOUR OWN FILES HERE...
 
  ;Store installation folder
  WriteRegStr HKCU "Software\Jim Michaels\pwdgen" "" $INSTDIR
 
  ;Create uninstaller
  WriteUninstaller "$INSTDIR\Uninstall.exe"
 
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
   
    ;Create shortcuts
    CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
    CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe"

;set up add/remove programs control panel entry
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "DisplayName" "pwdgen 1.7"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "URLUpdateInfo" "http://JesusnJim.com/code/pwdgen.html"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "URLInfoAbout" "http://JesusnJim.com/code/pwdgen.html"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "VersionMajor" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "VersionMinor" 7
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "DisplayVersion" "1.7"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen" "Publisher" "Jim Michaels"

!insertmacro MUI_STARTMENU_WRITE_END

SectionEnd


Section "pwdgen, GUI(Windows) 1.7" Sec_gui
CreateDirectory '$INSTDIR\dos'
CreateDirectory '$INSTDIR\js'
CreateDirectory '$INSTDIR\perl'
CreateDirectory '$INSTDIR\autoit3'
CreateDirectory '$INSTDIR\win'

CopyFiles '\CHANGELOG'                   '$INSTDIR\CHANGELOG'
CopyFiles '\gpl.txt'                     '$INSTDIR\gpl.txt'
CopyFiles '\pwdgen.lsm'                  '$INSTDIR\pwdgen.lsm'
CopyFiles '\readme.txt'                  '$INSTDIR\readme.txt'
CopyFiles '\setup.nsi'                   '$INSTDIR\setup.nsi'
CopyFiles '\autoit3\CHANGELOG'           '$INSTDIR\autoit3\CHANGELOG'
CopyFiles '\autoit3\pwdgen.au3'          '$INSTDIR\autoit3\pwdgen.au3'
CopyFiles '\autoit3\pwdgen.exe'          '$INSTDIR\autoit3\pwdgen.exe'
CopyFiles '\autoit3\pwdgen64.au3'        '$INSTDIR\autoit3\pwdgen64.au3'
CopyFiles '\autoit3\pwdgen64.exe'        '$INSTDIR\autoit3\pwdgen64.exe'

CreateDirectory '$SMPROGRAMS\$StartMenuFolder'

CreateShortCut '$SMPROGRAMS\$StartMenuFolder\GPL license.lnk' '$INSTDIR\gpl.txt'
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\readme.lnk'  '$INSTDIR\readme.txt'

CreateShortCut '$SMPROGRAMS\$StartMenuFolder\GPL license.lnk' '$INSTDIR\gpl.txt'
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\readme.lnk'  '$INSTDIR\readme.txt'
${If} ${RunningX64}
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\generate password.lnk'  '$INSTDIR\autoit3\pwdgen64.exe'
${Else}
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\generate password.lnk' '$INSTDIR\autoit3\pwdgen.exe'
${EndIf}
    ;MessageBox MB_OK|MB_ICONEXCLAMATION "add '$INSTDIR\cmd-line\win' from your PATH.  This installer cannot do it safely."
SectionEnd


Section "pwdgen, cmd-line 1.7" Sec_cmd
    CopyFiles '\CHANGELOG'                   '$INSTDIR\CHANGELOG'
    CopyFiles '\gpl.txt'                     '$INSTDIR\gpl.txt'
    CopyFiles '\pwdgen.lsm'                  '$INSTDIR\pwdgen.lsm'
    CopyFiles '\readme.txt'                  '$INSTDIR\readme.txt'
    CopyFiles '\setup.nsi'                   '$INSTDIR\setup.nsi'
    CopyFiles '\autoit3\CHANGELOG'           '$INSTDIR\autoit3\CHANGELOG'
    CopyFiles '\autoit3\pwdgen.au3'          '$INSTDIR\autoit3\pwdgen.au3'
    CopyFiles '\autoit3\pwdgen.exe'          '$INSTDIR\autoit3\pwdgen.exe'
    CopyFiles '\autoit3\pwdgen64.au3'        '$INSTDIR\autoit3\pwdgen64.au3'
    CopyFiles '\autoit3\pwdgen64.exe'        '$INSTDIR\autoit3\pwdgen64.exe'
    CopyFiles '\dos\atoi64.cpp'              '$INSTDIR\dos\atoi64.cpp'
    CopyFiles '\dos\atoi64.h'                '$INSTDIR\dos\atoi64.h'
    CopyFiles '\dos\build.bat'               '$INSTDIR\dos\build.bat'
    CopyFiles '\dos\errgp'                   '$INSTDIR\dos\errgp'
    CopyFiles '\dos\gp.bat'                  '$INSTDIR\dos\gp.bat'
    CopyFiles '\dos\gp.cmd'                  '$INSTDIR\dos\gp.cmd'
    CopyFiles '\dos\pwdgen.cpp'              '$INSTDIR\dos\pwdgen.cpp'
    CopyFiles '\dos\pwdgen.exe'              '$INSTDIR\dos\pwdgen.exe'
    CopyFiles '\js\pwdgen.js'                '$INSTDIR\js\pwdgen.js'
    CopyFiles '\perl\CHANGELOG'              '$INSTDIR\perl\CHANGELOG'
    CopyFiles '\perl\pwdgen.cmd'             '$INSTDIR\perl\pwdgen.cmd'
    CopyFiles '\perl\pwdgen.pl'              '$INSTDIR\perl\pwdgen.pl'
    CopyFiles '\win\atoi64.cpp'              '$INSTDIR\win\atoi64.cpp'
    CopyFiles '\win\atoi64.h'                '$INSTDIR\win\atoi64.h'
    CopyFiles '\win\bcc.cmd'                 '$INSTDIR\win\bcc.cmd'
    CopyFiles '\win\build.cmd'               '$INSTDIR\win\build.cmd'
    CopyFiles '\win\errgw'                   '$INSTDIR\win\errgw'
    CopyFiles '\win\gw.cmd'                  '$INSTDIR\win\gw.cmd'
    CopyFiles '\win\pwdgen.cpp'              '$INSTDIR\win\pwdgen.cpp'
    CopyFiles '\win\pwdgen.exe'              '$INSTDIR\win\pwdgen.exe'
    CopyFiles '\win\pwdgen.exe.manifest'     '$INSTDIR\win\pwdgen.exe.manifest'
    CopyFiles '\win\pwdgen.manifest.rc'      '$INSTDIR\win\pwdgen.manifest.rc'
    CopyFiles '\win\pwdgen.manifest.res'     '$INSTDIR\win\pwdgen.manifest.res'
    CopyFiles '\win\pwdgen64.exe'            '$INSTDIR\win\pwdgen64.exe'
    CopyFiles '\win\pwdgen64.exe.manifest'   '$INSTDIR\win\pwdgen64.exe.manifest'
    CopyFiles '\win\pwdgen64.manifest.rc'    '$INSTDIR\win\pwdgen64.manifest.rc'
    CopyFiles '\win\pwdgen64.manifest.res'   '$INSTDIR\win\pwdgen64.manifest.res'
CreateDirectory '$SMPROGRAMS\$StartMenuFolder'
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\GPL license.lnk' '$INSTDIR\gpl.txt'
CreateShortCut '$SMPROGRAMS\$StartMenuFolder\readme.lnk'  '$INSTDIR\readme.txt'
SectionEnd




;--------------------------------
;Descriptions

  ;Language strings
;  LangString DESC_Sec_dos ${LANG_ENGLISH} "pwdgen, Command-line version(DOS)"
  LangString DESC_Sec_cmd ${LANG_ENGLISH} "pwdgen, Command-line version(Windows and DOS). DOS/9x/me/nt/2000/2003/xp/vista/7."
  LangString DESC_Sec_gui ${LANG_ENGLISH} "pwdgen, GUI version(Windows). 32 and 64-bit. 2000/2003/xp/vista/7."

  ;Assign language strings to sections.
  ;makes checkboxes in the installer page in this order.
  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
    !insertmacro MUI_DESCRIPTION_TEXT ${Sec_gui} $(DESC_Sec_gui)
    !insertmacro MUI_DESCRIPTION_TEXT ${Sec_cmd} $(DESC_Sec_cmd)
;    !insertmacro MUI_DESCRIPTION_TEXT ${Sec_dos} $(DESC_Sec_dos)
  !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
;--------------------------------
;Uninstaller Section

Function un.onInit
;set context of $SMPROGRAMS and $APPDATA to All Users rather than Current User.
SetShellVarContext all
FunctionEnd

Section "Uninstall"
;close any open windows of pwdgen
lupe:
Processes::FindProcess "pwdgen" ;without ".exe"
Pop $R0
StrCmp $R0 "1" +1 a1
; Searches the currently running processes for the given
; process name.
;
; return: 1 - the process was found
; 0 - the process was not found

Processes::KillProcess "pwdgen" ; without ".exe"

; Searches the currently running processes for the given
; process name. If the process is found then the it gets
; killed.
;
; return: 1 - the process was found and killed
; 0 - the process was not found or the process
; cannot be killed (insuficient rights)
Pop $R0
StrCmp $R0 "1" +1 exitlupe ;if fail to kill process, exit so we don't get in permanent loop.
a1:
Processes::FindProcess "pwdgen64" ;without ".exe"
Pop $R0
StrCmp $R0 "1" +1 exitlupe
; Searches the currently running processes for the given
; process name.
;
; return: 1 - the process was found
; 0 - the process was not found

Processes::KillProcess "pwdgen64" ; without ".exe"

; Searches the currently running processes for the given
; process name. If the process is found then the it gets
; killed.
;
; return: 1 - the process was found and killed
; 0 - the process was not found or the process
; cannot be killed (insuficient rights)
Pop $R0
StrCmp $R0 "1" +1 exitlupe ;if fail to kill process, exit so we don't get in permanent loop.
Goto lupe
exitlupe:

Delete "$INSTDIR\Uninstall.exe"

RMDir "$INSTDIR"
 
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
   
Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
RMDir "$SMPROGRAMS\$StartMenuFolder"
 
DeleteRegKey /ifempty HKCU "Software\pwdgen"

;remove files
    Delete '$INSTDIR\CHANGELOG'
    Delete '$INSTDIR\gpl.txt'
    Delete '$INSTDIR\pwdgen.lsm'
    Delete '$INSTDIR\readme.txt'
    Delete '$INSTDIR\setup.nsi'
    Delete '$INSTDIR\autoit3\CHANGELOG'
    Delete '$INSTDIR\autoit3\pwdgen.au3'
    Delete '$INSTDIR\autoit3\pwdgen.exe'
    Delete '$INSTDIR\autoit3\pwdgen64.au3'
    Delete '$INSTDIR\autoit3\pwdgen64.exe'
    Delete '$INSTDIR\dos\atoi64.cpp'
    Delete '$INSTDIR\dos\atoi64.h'
    Delete '$INSTDIR\dos\build.bat'
    Delete '$INSTDIR\dos\errgp'
    Delete '$INSTDIR\dos\gp.bat'
    Delete '$INSTDIR\dos\gp.cmd'
    Delete '$INSTDIR\dos\pwdgen.cpp'
    Delete '$INSTDIR\dos\pwdgen.exe'
    Delete '$INSTDIR\js\pwdgen.js'
    Delete '$INSTDIR\perl\CHANGELOG'
    Delete '$INSTDIR\perl\pwdgen.cmd'
    Delete '$INSTDIR\perl\pwdgen.pl'
    Delete '$INSTDIR\win\atoi64.cpp'
    Delete '$INSTDIR\win\atoi64.h'
    Delete '$INSTDIR\win\bcc.cmd'
    Delete '$INSTDIR\win\build.cmd'
    Delete '$INSTDIR\win\errgw'
    Delete '$INSTDIR\win\gw.cmd'
    Delete '$INSTDIR\win\pwdgen.cpp'
    Delete '$INSTDIR\win\pwdgen.exe'
    Delete '$INSTDIR\win\pwdgen.exe.manifest'
    Delete '$INSTDIR\win\pwdgen.manifest.rc'
    Delete '$INSTDIR\win\pwdgen.manifest.res'
    Delete '$INSTDIR\win\pwdgen64.exe'
    Delete '$INSTDIR\win\pwdgen64.exe.manifest'
    Delete '$INSTDIR\win\pwdgen64.manifest.rc'
    Delete '$INSTDIR\win\pwdgen64.manifest.res'
;delete shortcuts
Delete '$SMPROGRAMS\$StartMenuFolder\GPL license.lnk'
Delete '$SMPROGRAMS\$StartMenuFolder\readme.lnk'
Delete '$SMPROGRAMS\$StartMenuFolder\generate password.lnk'

;after removing files, remove subdirectories the files were in.
RMDir '$INSTDIR\dos'
RMDir '$INSTDIR\js'
RMDir '$INSTDIR\perl'
RMDir '$INSTDIR\autoit3'
RMDir '$INSTDIR\win'

RMDir '$INSTDIR'
RMDir '$SMPROGRAMS\$StartMenuFolder'
DeleteRegKey HKCU "Software\Jim Michaels\pwdgen"
    ;MessageBox MB_OK|MB_ICONEXCLAMATION "remove '$INSTDIR\cmd-line\win' and '$INSTDIR\cmd-line\dos' from your PATH.  This installer cannot do it safely."
;remove add/remove programs control panel entry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\pwdgen"
;remove directories, c:\program files subfolder and Start Menu subfolder
RMDir /r /REBOOTOK '$INSTDIR'
RMDir /r /REBOOTOK "$SMPROGRAMS\$StartMenuFolder"
SectionEnd


I hope this helps.  I noticed that you already have an installer for modplug player.  I was just hoping for an installer for modplug tracker.
----------------------------
Jim Michaels

Offline LPChip

  • Administrator
  • *****
  • Posts: 5,005
    • http://lpchip.nl
  • Operating System: Windows 10 Pro N (x64bit)
create installer for OpenMPT
« Reply #1 on: January 01, 2010, 10:50:29 »
As long as there's a version without an installer, I'm okay with either.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,512
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
create installer for OpenMPT
« Reply #2 on: January 01, 2010, 11:19:20 »
I have already created a InnoSetup installer. You should have searched the forum, this has been requested before.

Just for the reference, this is already working:

Code: [Select]
; OpenMPT Install script

[Setup]
AppId=OpenMPT
AppVerName=OpenMPT 1.17.03.03
AppVersion=1.17.03.03
AppName=OpenMPT
AppPublisher=OpenMPT Devs / Olivier Lapicque
AppPublisherURL=http://www.openmpt.com/
AppSupportURL=http://www.openmpt.com/
AppUpdatesURL=http://www.openmpt.com/
DefaultDirName={pf}\OpenMPT
DefaultGroupName=OpenMPT
AllowNoIcons=yes
OutputDir=***
OutputBaseFilename=OpenMPT Setup
Compression=lzma
SolidCompression=yes
WizardImageFile=install-big.bmp
WizardSmallImageFile=install-small.bmp
;LicenseFile=license.txt
;CreateUninstallRegKey=no

[Tasks]
; icons and install mode
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "portable"; Description: "Use program directory to store configuration in (portable mode)"; GroupDescription: "Options:"; Flags: unchecked
; file associations - put this below all other [tasks]!
#include "filetypes.iss"

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

[Files]
; preserve file type order for best solid compression results (first binary, then text)
; home folder
***
; soundtouch license stuff
***
; keymaps
***

[Dirs]
; option dirs for non-portable mode
Name: "{userappdata}\OpenMPT"; Tasks: not portable
Name: "{userappdata}\OpenMPT\tunings"; Tasks: not portable
; dirst for portable mode
Name: "{app}\tunings"; Tasks: portable

[Icons]
; start menu
Name: "{group}\{cm:LaunchProgram,OpenMPT}";           Filename: "{app}\mptrack.exe"
Name: "{group}\{cm:UninstallProgram,OpenMPT}";        Filename: "{uninstallexe}"
Name: "{group}\ModPlug Central";                      Filename: "{app}\ModPlug Central.url"
Name: "{group}\Configuration files";                  Filename: "{userappdata}\OpenMPT\"; Tasks: not portable

; app's directory (for ease of use)
Name: "{app}\Configuration files";                    Filename: "{userappdata}\OpenMPT\"; Tasks: not portable

; desktop, quick launch
Name: "{userdesktop}\OpenMPT";                        Filename: "{app}\mptrack.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\OpenMPT"; Filename: "{app}\mptrack.exe"; Tasks: quicklaunchicon

[INI]
; enable portable mode
Filename: "{app}\mptrack.ini"; Section: "Paths"; Key: "UseAppDataDirectory"; String: "0"; Flags: uninsdeleteentry createkeyifdoesntexist; Tasks: portable
; internet shortcut
Filename: "{app}\ModPlug Central.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.lpchip.com/modplug/"; Flags: createkeyifdoesntexist;

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

[UninstallDelete]
; internet shortcut has to be deleted manually
Type: files; Name: "{app}\ModPlug Central.url";
; normal installation
Type: files; Name: "{userappdata}\OpenMPT\mptrack.ini"; Tasks: not portable
Type: files; Name: "{userappdata}\OpenMPT\plugin.cache"; Tasks: not portable
Type: files; Name: "{userappdata}\OpenMPT\tunings\local_tunings.tc"; Tasks: not portable
Type: dirifempty; Name: "{userappdata}\OpenMPT\tunings"; Tasks: not portable
Type: dirifempty; Name: "{userappdata}\OpenMPT"; Tasks: not portable
; portable installation
Type: files; Name: "{app}\mptrack.ini"; Tasks: portable
Type: files; Name: "{app}\plugin.cache"; Tasks: portable
Type: files; Name: "{app}\tunings\local_tunings.tc"; Tasks: portable
Type: dirifempty; Name: "{app}\tunings"; Tasks: portable


filetypes.iss:

Code: [Select]
; OpenMPT Install script - File associations

[Setup]
ChangesAssociations=yes

[Tasks]
; common file extensions
Name: "associate_common";      Description: "Associate OpenMPT with common module files"; GroupDescription: "File associations:";
Name: "associate_common\mod";  Description: "ProTracker / Noise Tracker / etc. (MOD)";
Name: "associate_common\s3m";  Description: "Scream Tracker 3 (S3M)";
Name: "associate_common\xm";   Description: "Fasttracker 2 (XM)";
Name: "associate_common\it";   Description: "Impulse Tracker (IT)";
Name: "associate_common\itp";  Description: "Impulse Tracker Project (ITP)";
Name: "associate_common\mptm"; Description: "OpenMPT (MPTM)";
; same, but compressed
Name: "associate_common\compressed"; Description: "Above when compressed (MDR, MDZ, S3Z, XMZ, ITZ, MPTMZ)";
; less common
Name: "associate_exotic";     Description: "Associate OpenMPT with less common module files"; GroupDescription: "File associations:";
Name: "associate_exotic\669"; Description: "Composer 669 (669)";
Name: "associate_exotic\amf"; Description: "ASYLUM Music Format / Advanced Music Format (AMF)";
Name: "associate_exotic\ams"; Description: "Extreme Tracker (AMS)";
Name: "associate_exotic\dbm"; Description: "DigiBooster (DBM)";
Name: "associate_exotic\dmf"; Description: "X-Tracker (DMF)";
Name: "associate_exotic\dsm"; Description: "DSIK (DSM)";
Name: "associate_exotic\far"; Description: "Farandole Composer (FAR)";
Name: "associate_exotic\gdm"; Description: "General Digital Music (GDM)";
Name: "associate_exotic\imf"; Description: "Imago Orpheus (IMF)";
Name: "associate_exotic\j2b"; Description: "Jazz Jackrabbit 2 Music (J2B)";
Name: "associate_exotic\mdl"; Description: "DigiTracker (MDL)";
Name: "associate_exotic\med"; Description: "OctaMED (MED)";
Name: "associate_exotic\mo3"; Description: "MO3 compressed modules (MO3)";
Name: "associate_exotic\mt2"; Description: "MadTracker 2 (MT2)";
Name: "associate_exotic\mtm"; Description: "MultiTracker Modules (MTM)";
Name: "associate_exotic\okt"; Description: "Oktalyzer (OKT)";
Name: "associate_exotic\psm"; Description: "Epic Megagames MASI (PSM)";
Name: "associate_exotic\ptm"; Description: "PolyTracker (PTM)";
Name: "associate_exotic\stm"; Description: "Scream Tracker 2 (STM)";
Name: "associate_exotic\ult"; Description: "UltraTracker (ULT)";
Name: "associate_exotic\umx"; Description: "Unreal Music (UMX)";
Name: "associate_exotic\wow"; Description: "Grave Composer (WOW)";

[Registry]
; common file extensions
Root: HKCR; Subkey: ".mod";  ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\mod
Root: HKCR; Subkey: ".s3m";  ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\s3m
Root: HKCR; Subkey: ".xm";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\xm
Root: HKCR; Subkey: ".it";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\it
Root: HKCR; Subkey: ".itp";  ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\itp
Root: HKCR; Subkey: ".mptm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\mptm
; same, but compressed
Root: HKCR; Subkey: ".mdr";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
Root: HKCR; Subkey: ".mdz";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
Root: HKCR; Subkey: ".s3z";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
Root: HKCR; Subkey: ".xmz";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
Root: HKCR; Subkey: ".itz";   ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
Root: HKCR; Subkey: ".mptmz"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_common\compressed
; less common
Root: HKCR; Subkey: ".669"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\669
Root: HKCR; Subkey: ".amf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\amf
Root: HKCR; Subkey: ".ams"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ams
Root: HKCR; Subkey: ".dbm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dbm
Root: HKCR; Subkey: ".dmf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dmf
Root: HKCR; Subkey: ".dsm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\dsm
Root: HKCR; Subkey: ".far"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\far
Root: HKCR; Subkey: ".gdm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\gdm
Root: HKCR; Subkey: ".imf"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\imf
Root: HKCR; Subkey: ".j2b"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\j2b
Root: HKCR; Subkey: ".mdl"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mdl
Root: HKCR; Subkey: ".med"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\med
Root: HKCR; Subkey: ".mo3"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mo3
Root: HKCR; Subkey: ".mt2"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mt2
Root: HKCR; Subkey: ".mtm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\mtm
Root: HKCR; Subkey: ".okt"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\okt
Root: HKCR; Subkey: ".psm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\psm
Root: HKCR; Subkey: ".ptm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ptm
Root: HKCR; Subkey: ".stm"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\stm
Root: HKCR; Subkey: ".ult"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\ult
Root: HKCR; Subkey: ".umx"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\umx
Root: HKCR; Subkey: ".wow"; ValueType: string; ValueName: ""; ValueData: "OpenMPTFile"; Flags: uninsdeletevalue; Tasks: associate_exotic\wow

; important (setup)
Root: HKCR; Subkey: "OpenMPTFile"; ValueType: string; ValueName: ""; ValueData: "OpenMPT Module"; Flags: uninsdeletekey; Tasks: associate_common or associate_exotic
Root: HKCR; Subkey: "OpenMPTFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\mpt.ico,0"; Tasks: associate_common or associate_exotic
Root: HKCR; Subkey: "OpenMPTFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\mptrack.exe"" ""%1"""; Tasks: associate_common or associate_exotic

[Files]
; icon file (should be moved into EXE)
Source: "mpt.ico";            DestDir: "{app}"; Flags: ignoreversion

» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Waxhead

  • Workaholic artist
  • ***
  • Posts: 251
  • Gender: Male
    • http://www.dirtcellar.net
  • Operating System: WinXP , Linux
create installer for OpenMPT
« Reply #3 on: January 01, 2010, 13:02:24 »
If someone actually goes for the installer... I put a thumbs up for Innosetup.
I still think a self extracting archive would be just as good as a installer ;)

However for inexperienced users a installer would perhaps be a good idea tough!

Offline jmichae3

  • Shy artist
  • Posts: 5
    • http://JesusnJim.com
create installer for OpenMPT
« Reply #4 on: January 02, 2010, 02:34:48 »
just out of curiosity, if the installer has been created, why isn't it in the binaries package?  I couldn't seem to find an installer or even installer source.

yes, I did search for "installer" and "setup" and found nothing, so I posted (I was surprised that it seemed nobody had said anything by now too). I had no clue to seach for "innoSetup".
----------------------------
Jim Michaels

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,512
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 7 x64
create installer for OpenMPT
« Reply #5 on: January 02, 2010, 11:57:37 »
Because...
...no official release has been made since I wrote the script.
Simple as that! Yes, answers can sometimes be so easy!
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.