Script installers [MM2]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Mon May 01, 2006 11:44 am

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova » Wed May 03, 2006 7:10 am

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....

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Mon Jun 12, 2006 6:34 am

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

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).

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia » Thu Jun 29, 2006 11:47 am

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

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Thu Jun 29, 2006 12:02 pm

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia » Thu Jun 29, 2006 12:09 pm

Thanks for that, I feel aweful :( :oops:

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Thu Jun 29, 2006 1:57 pm

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.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Location: Belgium
Contact:

Post by Steegy » Thu Jun 29, 2006 4:28 pm

My installers don't seem to have any problems :-?
(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).

MoDementia
Posts: 1321
Joined: Thu Jun 15, 2006 3:26 pm
Location: Geelong, Victoria, Australia

Post by MoDementia » Thu Jun 29, 2006 6:44 pm

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).
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.

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Wed Aug 02, 2006 3:06 am

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"

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 %%%%%%%%%%%%%%%%%%%

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
Last edited by DiddeLeeDoo on Mon Aug 14, 2006 3:02 am, edited 11 times in total.
Image

Peke
Posts: 11993
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Post by Peke » Wed Aug 02, 2006 1:52 pm

Nice solution.
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX » Fri Jan 11, 2008 3:34 am

Information in this thread is out of date for MM3. Maybe we should remove the sticky?
Maybe replace with a link to the wiki?

Regards,
Red

jiri
Posts: 5388
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri » Fri Jan 11, 2008 5:55 am

Good idea, I canceled the sticky status.

Jiri

Post Reply