Shoutbox

Pack the script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Pack the script (/showthread.php?tid=65125)

Pack the script by SnuZZer on 08-19-2006 at 05:48 PM

Hi.
I'm from Denmark and my english isn't good.

I have made my own Messenger Plus! Live script and wants to make it to a .plsc file (So the users can import the script), but how do i make my script to a .plsc file?

- Simon


RE: Pack the script by Silentdragon on 08-19-2006 at 05:57 PM

Make sure you have a scriptinfo.xml file then zip the contents of the folder(not the folder itself) and rename .zip to .plsc


RE: Pack the script by SnuZZer on 08-19-2006 at 05:58 PM

Hi.
That doesn't work.

I can't find any programs to "plsc the script" :-$

Silentdragon ->
Hi.
I haven't got winzip, but winrar, can i use winrar?

In the folder der isn't any file called "scriptinfo.xml", actually there isn't any .xml file.
What shell the scriptinfo contain?


RE: Pack the script by Silentdragon on 08-19-2006 at 06:03 PM

Yes you can use winrar, just make sure you move the radio button to zip file isntead of rar file.

Example ScriptInfo.xml

code:
<ScriptInfo>   
    <Information>
        <Name>Answering Machine Plus</Name>
        <Description>Autoreplies to user specified messages.</Description>
        <AboutUrl>http://shoutbox.menthix.net/showthread.php?tid=64534</AboutUrl>
    </Information>
</ScriptInfo>

RE: Pack the script by haydos on 08-19-2006 at 06:03 PM

quote:
Originally posted by SnuZZer
In the folder der isn't any file called "scriptinfo.xml", actually there isn't any .xml file.
That's because you have to create this file yourself. This is the xml interface page for the little popup when the script is imported. You have to put this in the .zip file with your .js and any other files before changing the file type
RE: Pack the script by Dempsey on 08-19-2006 at 06:18 PM

Yo

quote:
Originally posted by SnuZZer
Hi.
That doesn't work.

I can't find any programs to "plsc the script" :-$
You can use Script Packager
RE: Pack the script by SnuZZer on 08-19-2006 at 07:02 PM

Hi.
I can't get it work.
When i have maked the plsc file and try to open the fil it says that it isn't a valid Messenger Plus! Live file :-(


RE: Pack the script by Silentdragon on 08-19-2006 at 07:09 PM

Make sure the xml is unicode. If it still doesn't work post it up here and I'll check whats wrong.


RE: Pack the script by CookieRevised on 08-19-2006 at 08:16 PM

SnuZZer,

ermmm.. please read the scripting documentation regarding script packs carefully.

Everything said in this thread is only a small part of what you must do and is majorly confusing if you're not that computer literate (not to mention certain things said in this thread are not totally correct).

Either do that or use a script pack tool like Demsey linked to.


A scriptpack includes:
* the JS files, these can be saved in Unicode (little endian) or ANSI.
* an mandatory scriptinfo.xml file. This file must be, in general, saved as Unicode (little endian) (Although you can save it as Ansi too, but in that case you need to define this in the XML header). Don't forget to include an xml header. The proper contents of the file can be found in the scripting documentation. The file is something you need to create manually.
* other files. for more on these, read the scripting documentation.

Everything must be saved under the root in the scriptpack, thus not in a subdirectory.

A scriptpack is actually a normal ZIP file, but with its extension renamed to plsc.

All this and in more detail can be read in the scripting documentation. Read it very very carefully.





-----------------------------------------------------------------------------------------

@others: try to explain stuff 100% correctly. Very good that you try to help, but almost all posts in this thread so far are not much of a help at all and will in fact make it even more confusing since they don't mention the details and not all facts are given. sorry....

quote:
Originally posted by gjs1992
Put it in a Zip File and link it in MS Front Page or something to iits current location on the PC and right click then save target as and put at the end of the filename .plsc
Majorly confusing. And what has FrontPage todo with all this?
quote:
Originally posted by Silentdragon
Make sure you have a scriptinfo.xml file
You forget to mention that the file must be saved in either unicode or ansi depending on what its contents are (xml encoding).
quote:
Originally posted by Silentdragon
Example ScriptInfo.xml
code:
<ScriptInfo>   
    <Information>
        <Name>Answering Machine Plus</Name>
        <Description>Autoreplies to user specified messages.</Description>
        <AboutUrl>http://shoutbox.menthix.net/showthread.php?tid=64534</AboutUrl>
    </Information>
</ScriptInfo>

You forget the important xml header.
quote:
Originally posted by Silentdragon
Make sure the xml is unicode.
That in general is true, but only when you don't have a xml header (which is actually good practice to include it) or if the header says it is UTF-16 encoded. If the header says it is UTF-8 encoded then it should be ansi.
RE: Pack the script by SnuZZer on 08-19-2006 at 09:38 PM

CookieRevised ->
Hi.
I have read the documentation and i have tried to make my JS-file (Leet beskeder.js) and ScriptInfo.xml to a .rar file and change .rar til to .plsc, but when i try to open the .plsc file i got the message:
"The file you tried to read isn't a valid Messenger Plus! script-pack"


RE: Pack the script by Silentdragon on 08-19-2006 at 09:41 PM

Must be a zip file, you can use win rar to make ZIP file. When you create an archive winrar you should have the option to pick zip or rar.


RE: Pack the script by Ezra on 08-19-2006 at 09:46 PM


quote:
Originally posted by SnuZZer
CookieRevised ->
Hi.
I have read the documentation and i have tried to make my JS-file (Leet beskeder.js) and ScriptInfo.xml to a .rar file and change .rar til to .plsc, but when i try to open the .plsc file i got the message:
"The file you tried to read isn't a valid Messenger Plus! script-pack"

Make sure the Scriptinfo.xml file is saved as UTF-16 Little Endian Unicode.

Then use WinRAR to put both files (Leet beskeder.js & Scriptinfo.xml) in a ZIP archive, so make sure the radio button on the WinRar interface is selected to ZIP. After you did this rename the created ZIP file to PLSC and try again.
RE: Pack the script by SnuZZer on 08-19-2006 at 10:01 PM

Hi.
It works!!
Thanks!!

I changed ScriptInfo.xml's type to "Unicode big endian".
I packed Leet beskeder.js and ScriptInfo.xml in a .zip file with WinRAR and changed the filetype to .plsc.
..and.. Now it works!! Thanks!!


Hi again. :-$
I don't think this is the right forum, but i hope someone can help me.
When i upload my .plsc file (Leet beskeder.plsc) to my server and link it to download it's a .rar file the users download :-(
Here is a example: www.snuzzer.dk/msgplus
RE: Pack the script by Ezra on 08-19-2006 at 10:14 PM

It works fine here, I think there's something wrong with your settings or something.

What browser do you use?


RE: Pack the script by SnuZZer on 08-19-2006 at 10:18 PM

Ezra ->
I use Internet Explorer, but if i download something from MSG Plus! Live's script database it works fine.

Are you sure.. Doesn't it open the file with WinRAR/WinZIP?


RE: Pack the script by Ezra on 08-19-2006 at 10:24 PM

quote:
Originally posted by SnuZZer
Ezra ->
I use Internet Explorer, but if i download something from MSG Plus! Live's script database it works fine.

Are you sure.. Doesn't it open the file with WinRAR/WinZIP?



I'm sure :-), Plus! want to import it.
RE: Pack the script by Supersonicdarky on 08-19-2006 at 11:03 PM

make sure to assosiate .plsc files with MPtools.exe (loocated where you installed msg plus!)


RE: Pack the script by SnuZZer on 08-20-2006 at 07:37 AM

Hi.
When i double click på the original Leet beskeder.plsc Messenger Plus! Live try ti import it, but if i download the file from www.snuzzer.dk/msgplus it's a WinRAR file :-/


RE: Pack the script by alexp2_ad on 08-20-2006 at 10:30 AM

Yes, Internet Explorer has this problem.  It thinks it's a zip so it downloads it as a zip.  I get round it by putting the script in a separate folder on the server from the html and the rest and then putting in a file called .htaccess saying:

code:
ForceType application/x-plsc


That should work.

Adding the type elsewhere didn't work right for me, so I had to use ForceType and a separate folder.
RE: RE: Pack the script by mickael9 on 08-20-2006 at 11:42 AM

quote:
Originally posted by alexp2_ad
Yes, Internet Explorer has this problem.  It thinks it's a zip so it downloads it as a zip.  I get round it by putting the script in a separate folder on the server from the html and the rest and then putting in a file called .htaccess saying:

code:
ForceType application/x-plsc


That should work.

Adding the type elsewhere didn't work right for me, so I had to use ForceType and a separate folder.

Or you can create a php script :
code:
<?php

// download.php?script=xxx (no .plsc)

$script = $_GET['script'];

if (strpos($script,".") > -1 || strpos($script,"/") > -1 || strpos($script,"\\")  > -1 || strpos($script,'"') > -1 || !is_file("./$script.plsc"))
    die("File not found");

header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $script . '.plsc"');

readfile("./$script.plsc");

?>

RE: Pack the script by SnuZZer on 08-20-2006 at 01:56 PM

Hi.
Ofcurse PHP!!
Thanks!!

I changed the script a bit:

code:
<?
$script = $_GET[script];
$tjek = $script.".plsc";

if (file_exists($tjek)) {

header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $script . '.plsc"');
readfile("$script.plsc");

} else {
echo "$tjek blev ikke fundet på serveren.";
}
?>

RE: Pack the script by Menthix on 08-20-2006 at 02:06 PM

Hmm, this sounds interesting....

Because I has a few reports from people who had WinZip and such popping up when downloading from the scripts DB too.

So that code is confirmed to work?:

code:
header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $filename . "');
readfile("$filename");

RE: Pack the script by Ezra on 08-20-2006 at 02:15 PM

quote:
Originally posted by MenthiX
Hmm, this sounds interesting....

Because I has a few reports from people who had WinZip and such popping up when downloading from the scripts DB too.

So that code is confirmed to work?:
code:
header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $filename . "');
readfile("$filename");


I think it's just the header "Content-Type: application/x-plsc" that does it.
RE: RE: Pack the script by mickael9 on 08-20-2006 at 03:10 PM

quote:
Originally posted by SnuZZer
Hi.
Ofcurse PHP!!
Thanks!!

I changed the script a bit:
code:
<?
$script = $_GET[script];
$tjek = $script.".plsc";

if (file_exists($tjek)) {

header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $script . '.plsc"');
readfile("$script.plsc");

} else {
echo "$tjek blev ikke fundet på serveren.";
}
?>

Bad idea !
code:
<?
$script = $_GET[script]; // no! php search for the 'script' constant
$tjek = $script.".plsc"; // "$script.plsc" is more simple ...

if (file_exists($tjek)) { // and if I insert ../[...] , /home/[...],  C:\[...], http://[...], ftp://[...] ; file_exists will accept a folder too

header("Content-Type: application/x-plsc");
header('Content-Disposition: attachment; filename="' . $script . '.plsc"');
readfile("$script.plsc");

} else {
echo "$tjek blev ikke fundet på serveren."; // XSS vulnerability, $tjek = <script>alert("Cookies: " + document.cookie);</script>
}
?>

@Ezra : yes, but if you don't put the Content-Disposition header, you will get a download.php file :p

Edit : a more clean code :
code:
<?php

$script = (get_magic_quotes_gpc() ? stripslashes($_GET['script']) : $_GET['script']);
$scriptfn= "$script.plsc";

$error = 0;

if (empty($script))
    $error = 1;

else if (preg_match('#[/\\\\."]#', $script))
    $error = 2;

else if (!is_file($scriptfn))
   $error = 3;

if ($error === 0)
{
    header("Content-Type: application/x-plsc");
    header('Content-Disposition: attachment; filename="' . $scriptfn . '"');

    readfile($scriptfn);
}
else
{
    $scriptfn = htmlentities($scriptfn);
   
    switch ($error)
    {
        case 1:
            echo "File is empty !";
            break;
        case 2:
            echo "Illegal characters in file : $scriptfn";
            break;
        case 3:
            echo "File not found : $scriptfn";
            break;
    }
}

?>


Just change the error messages ...
RE: Pack the script by Ezra on 08-20-2006 at 03:23 PM

quote:
Originally posted by mickael9

@Ezra : yes, but if you don't put the Content-Disposition header, you will get a download.php file

Yeah I know that, but as the download system from the database already works correctly, only that IE users sometimes download a .zip file, I meant that Menthix could probably fix that by only adding that to the headers :-)