
Script installers [MM2]
After a little testing it occured to me what the problem with overwritting the uninstall information was. AppId. Change this value and everything is fine, you get a seperate uninstall which removes the files correctly. Excellent! 

Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Yes, that is the sollution...
I came up to this problem after i created my first install.
I reported it to Jiri and and i used the fix that Trix described for all the installlers i created since then
I think i should had reported it here from the beginning, that would have saved some trouble for you guys....
I came up to this problem after i created my first install.
I reported it to Jiri and and i used the fix that Trix described for all the installlers i created since then
I think i should had reported it here from the beginning, that would have saved some trouble for you guys....
I'd like to share the "Inno Setup" script I've used for e.g. my FavouritesNodes script, as it has a MM version checking before anything gets installed.
This seems like a very useful thing to me. It prevents version problems in an early phase.
To change the "minimum required version" of MediaMonkey that is able to run your script, you have to set "MinimumVersion" to the right version number.
[Setup]
AppId=MediaMonkey Script: FavouriteNodes v1.1
AppName=MediaMonkey Script: FavouriteNodes
AppVerName=MediaMonkey Script: FavouriteNodes v1.1
AppVersion=1.1
AppPublisher=SteegyCorp
AppPublisherURL=http://home.tiscali.be/ruben.castelein
AppSupportURL=http://www.mediamonkey.com/forum/viewtopic.php?t=7656
AppUpdatesURL=http://www.mediamonkey.com/forum/viewtopic.php?t=7656
DefaultDirName={code:MMPath}
DefaultGroupName=MediaMonkey
AppCopyright=Copyright © SteegyCorp
OutputBaseFilename=FavouriteNodes
UpdateUninstallLogAppName=false
DirExistsWarning=no
;DisableDirPage=yes
DisableProgramGroupPage=true
SolidCompression=true
Compression=lzma
ShowLanguageDialog=yes
VersionInfoVersion=1.1
VersionInfoCompany=SteegyCorp
VersionInfoDescription=MediaMonkey Script: FavouriteNodes v1.1
VersionInfoTextVersion=FavouriteNodes v1.1
VersionInfoCopyright=Copyright © SteegyCorp
OutputDir=C:\MMScripts\Output
SourceDir=C:\MMScripts
[Files]
Source: C:\MMScripts\FavouriteNodes.vbs; DestDir: {app}\Scripts\Auto; Flags: ignoreversion promptifolder
This seems like a very useful thing to me. It prevents version problems in an early phase.
To change the "minimum required version" of MediaMonkey that is able to run your script, you have to set "MinimumVersion" to the right version number.
[Setup]
AppId=MediaMonkey Script: FavouriteNodes v1.1
AppName=MediaMonkey Script: FavouriteNodes
AppVerName=MediaMonkey Script: FavouriteNodes v1.1
AppVersion=1.1
AppPublisher=SteegyCorp
AppPublisherURL=http://home.tiscali.be/ruben.castelein
AppSupportURL=http://www.mediamonkey.com/forum/viewtopic.php?t=7656
AppUpdatesURL=http://www.mediamonkey.com/forum/viewtopic.php?t=7656
DefaultDirName={code:MMPath}
DefaultGroupName=MediaMonkey
AppCopyright=Copyright © SteegyCorp
OutputBaseFilename=FavouriteNodes
UpdateUninstallLogAppName=false
DirExistsWarning=no
;DisableDirPage=yes
DisableProgramGroupPage=true
SolidCompression=true
Compression=lzma
ShowLanguageDialog=yes
VersionInfoVersion=1.1
VersionInfoCompany=SteegyCorp
VersionInfoDescription=MediaMonkey Script: FavouriteNodes v1.1
VersionInfoTextVersion=FavouriteNodes v1.1
VersionInfoCopyright=Copyright © SteegyCorp
OutputDir=C:\MMScripts\Output
SourceDir=C:\MMScripts
[Files]
Source: C:\MMScripts\FavouriteNodes.vbs; DestDir: {app}\Scripts\Auto; Flags: ignoreversion promptifolder
Code: Select all
function MMPath(Default: String): String;
var
PrevPath : String;
begin
PrevPath := '';
RegQueryStringValue( HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaMonkey_is1', 'Inno Setup: App Path', PrevPath);
if FileExists( AddBackslash( PrevPath)+'\MediaMonkey.exe') then
Result := AddBackslash( PrevPath)
else
Result := AddBackslash( ExpandConstant('{pf}'))+'MediaMonkey\';
end;
function InitializeSetup(): Boolean;
var
MinimumVersion : String;
var
AppVersion : String;
begin
Result := false;
MinimumVersion := '2.5.2.951';
if GetVersionNumbersString(MMPath('') + 'MediaMonkey.exe', AppVersion) then
if AppVersion >= MinimumVersion then
Result := true
else
MsgBox('This script requires MediaMonkey version '+MinimumVersion+' or newer.'+#10+'Your version is '+AppVersion+#10+#10+'Please visit www.mediamonkey.com to get the latest version of MediaMonkey.'+#10+'The latest releases (including Betas and RCs) can be downloaded from the forum.', mbError, MB_OK)
else
if MsgBox('The current version of MediaMonkey could not be found, so the installed version number could not be determined.'+#10+'It''s possible that the installed version is older than the required version ('+MinimumVersion+') for this script.'+#10+#10+'Do you want to install the script?', mbError, MB_YESNO or MB_DEFBUTTON2) = IDYES then
Result := true;
end;
[_ISTool]
UseAbsolutePaths=true[/color]
Of course, if you use this script, be sure to change all relevant things for your own script (e.g. the AppX settings, the VersionInfoX settings, Source, Output, ...)
BTW: If you create Inno Setups, I strongly recommend the ISTool setup creation GUI (avaliable as package from Inno's website, together with the setup compiler).
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Please remove this announcement or fix the supplied sample
2. Download a sample script installer from http://www.mediamonkey.com/scripts/Scri ... tTitle.iss
One or the other asap
Thanks
2. Download a sample script installer from http://www.mediamonkey.com/scripts/Scri ... tTitle.iss
One or the other asap
Thanks
I've put a note on the original thread, but hopefully the sample will be corrected by the MM team as well. Thanks for pointing this out.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Don't worry, a lot of people had similar problems with my earlier scripts. I'm still in the process of fixing all of my installers now! 

Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
My installers don't seem to have any problems 
(ok, except the size reported incorrectly, but who cares about that?)

(ok, except the size reported incorrectly, but who cares about that?)
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
I just had a quick look at the IStool package and also strongly recommend it. It will make dotting Is and crossing Ts so much easier.Steegy wrote:BTW: If you create Inno Setups, I strongly recommend the ISTool setup creation GUI (avaliable as package from Inno's website, together with the setup compiler).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
Simple Script Installer
This script is like a container for scripts, and install scripts as defined by the InstallScriptTo command.
InstallScriptTo "Auto\ScriptName.vbs", LineBegin, LineEnd, "Message after Installation finished"
If having many scripts to install at once, write something like
InstallScriptTo "Auto\MyScriptName.vbs", 20, 120, "none"
InstallScriptTo "MyOtherFileName.vbs", 122, 250, "MessageText"
More stuff can be done too, and many things are happening in the AutoRateSongs Installer, like Scripts.ini modification, Reg read, ini write.
http://www.mediamonkey.com/forum/viewtopic.php?t=9241
This script is like a container for scripts, and install scripts as defined by the InstallScriptTo command.
InstallScriptTo "Auto\ScriptName.vbs", LineBegin, LineEnd, "Message after Installation finished"
Code: Select all
'-------------------------OPEN---------------------------------
Dim FSO : Set FSO=CreateObject("Scripting.FileSystemObject")
Dim SDB : Set SDB=CreateObject("SongsDB.SDBApplication")
While Not SDB.isRunning : WScript.Sleep 500 : Wend
'--------------------------------------------------------------
InstallScriptTo "Auto\XXXXXXXXX.vbs", LineBegin, LineEnd , _
_
"Script Successfully Installed!" &vbLf&_
"Please restart MediaMonkey" &vbLf&_
"Other notes to user after install....."
'--------------------------CLOSE-------------------------------
SDB.ShutdownAfterDisconnect=True
Set FSO=Nothing : Set SDB=Nothing : Wscript.Quit
'--------------------------------------------------------------
'This is line 20, and you can paste your script in here and see
'what the end line is to do the InstallScriptTo command options
'
'Like a 100 Line Script would need a command above like
'
'InstallScriptTo "Auto\MyScriptName.vbs", 20, 120, "MessageText"
'%%%%%%%%%%%%%%%%% START OF SCRIPT INSTALLER %%%%%%%%%%%%%%%%%%
Sub InstallScriptTo(ScriptName, LineBegin, LineEnd, Message)
ScriptName=SDB.ApplicationPath & "Scripts\" & ScriptName
RenameOldScript(ScriptName)
Set TXT=FSO.OpenTextFile(WScript.ScriptFullName,1)
STR=TXT.ReadAll
TXT.Close
LNS=Split(STR,vbNewLine)
Set TXT=FSO.CreateTextFile(ScriptName, True)
For i=LineBegin-1 To LineEnd-1
TXT.WriteLine LNS(i)
Next
TXT.Close
If FSO.FileExists(ScriptName) And Message<>"none" Then _
SDB.MessageBox Message , 2, Array(4)
End Sub
Sub RenameOldScript(ScriptName)
If FSO.FileExists(ScriptName) Then _
FSO.MoveFile ScriptName, BakFile(ScriptName)
End Sub
Function BakFile(ScriptName)
Do
TMP=Left(ScriptName, Len(ScriptName)-3) & "old" & v
v=v+1
Loop While FSO.FileExists(TMP)
BakFile=TMP
End Function
'%%%%%%%%%%%%%%%%%% END OF SCRIPT INSTALLER %%%%%%%%%%%%%%%%%%%
InstallScriptTo "Auto\MyScriptName.vbs", 20, 120, "none"
InstallScriptTo "MyOtherFileName.vbs", 122, 250, "MessageText"
More stuff can be done too, and many things are happening in the AutoRateSongs Installer, like Scripts.ini modification, Reg read, ini write.
http://www.mediamonkey.com/forum/viewtopic.php?t=9241
Last edited by DiddeLeeDoo on Mon Aug 14, 2006 3:02 am, edited 11 times in total.
Nice solution.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying


How to add SCREENSHOTS to forum
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying


How to add SCREENSHOTS to forum