SciLor's Open Source Forums

Also visit my Website!
It is currently Mon Dec 09, 2019 1:34 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri May 21, 2010 7:45 pm 
First of all thanks for GrooveDownloaderWM!

Unfortunately, I could not download at all because I got an exception anytime I started a download.

So I looked for the cause. I found the problem here

public static void StartUp()
{
AppPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
if (AppPath.StartsWith(@"file:\"))
{
AppPath = AppPath.Substring(6);
}
DownloadDir = Path.Combine(AppPath, "Downloads");
MyProject.Forms.frmGroove.Text = myProgram.longname + " - " + myProgram.version;
MyProject.Forms.frmGroove.Show();
}

in the AppPath initialization. I replaced it with my absolute location

public static void StartUp()
{
AppPath = @"\Storage Card\Program Files\GroovesharkDownloader";
DownloadDir = Path.Combine(AppPath, "Downloads");
MyProject.Forms.frmGroove.Text = myProgram.longname + " - " + myProgram.version;
MyProject.Forms.frmGroove.Show();
}

and now the program works.

Hope it helps for next release.


Top
  
 
 
Online
The Adswinger

Joined: Wed Jan 13, 2010 11:56 pm
Posts: Too many!
Donated: Ad Posts


PostPosted: Fri May 21, 2010 8:07 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1466
Donated: free software
Thank you for your support BUT!

The StartUp function doesn't affect the downloads itself directly (It runs and startup).

Code:
AppPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);

Just gets the application path

Code:
if (AppPath.StartsWith(@"file:\"))
{
AppPath = AppPath.Substring(6);
}

Gets just done if you run it on Windows itself.

I would like to know where you have copied the "not working" version on you device. Is it in "\Storage Card\Program Files\GroovesharkDownloader"?

Also I would like to know which error the programs throws!

_________________
My Windows Mobile and Windows Open Source Website:
www.scilor.com

Like my work? Donate!
Donation Website

My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
PostPosted: Fri May 21, 2010 8:54 pm 
SciLor wrote:
The StartUp function doesn't affect the downloads itself directly (It runs and startup).


Yes, I know. The problem is that StartUp initializes AppPath and/or DownloadDir to something wrong that produces an exception when it is used to create the path where store the downloaded files.

By the way, you used Assembly.GetExecutingAssembly().GetName().CodeBase It may be correct but I would have used Assembly.GetCallingAssembly.ManifestModule.FullyQualifiedName

SciLor wrote:
I would like to know where you have copied the "not working" version on you device. Is it in "\Storage Card\Program Files\GroovesharkDownloader"?)


Yes.

SciLor wrote:
I also I would like to know which error the programs throws!


The exception was a ArgumentException and was raised by the Directory.CreateDirectory here

private void btnDownload_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
this.btnAddToDownload.Enabled = false;
this.btnDownload.Enabled = false;
this.DownloadEnabled = true;
this.pgbAllDownloads.Value = 0;
this.pgbAllDownloads.Maximum = this.lstDownloadList.Items.Count;
int num4 = this.lstDownloadList.Items.Count - 1;
for (int i = 0; i <= num4; i++)
{
string path = Path.Combine(MyStartUp.DownloadDir, Path.Combine(Path.Combine(this.DownloadResults[i].ArtistName, this.DownloadResults[i].AlbumName + "(" + this.DownloadResults[i].Year + ")"), this.DownloadResults[i].ArtistName + " - " + this.DownloadResults[i].Name + " - " + this.DownloadResults[i].AlbumName + "(" + this.DownloadResults[i].Year + ").mp3"));
GroovesharkAudioStream musicStream = this.grooveClient.GetMusicStream(this.DownloadResults[i].SongID);
int num2 = 0;
byte[] buffer = new byte[0x400];
if (!Directory.Exists(Path.GetDirectoryName(path)))
{
Directory.CreateDirectory(Path.GetDirectoryName(path));


Last edited by oruam57 on Fri May 21, 2010 9:01 pm, edited 1 time in total.

Top
  
 
PostPosted: Fri May 21, 2010 8:58 pm 
Offline
The Developer

Joined: Wed Jan 13, 2010 11:56 pm
Posts: 1466
Donated: free software
Thank you,

the problem is, that I do not check for special characters, that are not allowed in paths when I use them for the directory names/file names.
This problem will be fixed :), I was just to lazy :D.

If you find any more problems, please continue posting them here ;)

_________________
My Windows Mobile and Windows Open Source Website:
www.scilor.com

Like my work? Donate!
Donation Website

My Programs:
grooveshark™.com Downloader, GrooveMobile, Fuel Blaster, Chameleon TicTacToe, QuickTap, WiMoBlue, Driving Licence Trainer, CodeSnippetViewer, Gesture Launcher, Fahrplanauskunft, GSensor Control


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
template->_php_include(): File ./counter/foruminclude.php does not exist or is empty Powered by phpBB® Forum Software © phpBB Group