Installed Version Of My App Doesn't Work

I went through changing the values and made sure all the correct files were in place on installing my app with InnoSetup. For some reason, it executes the code in unhandledexception event of the app which opens a text file with the error log. Usually the error log would appear but it doesn’t when I open the my installed app. If I open the original build then there is no error.

The annoying thing about the error log is there is nothing in the stack trace or no information to tell me what the error is. This error does not appear in the original build files but only when I copy ALL the files required to run the application.

It seems to execute the unhandledexception method twice.

Thanks

Do you use GetFolderItem without second parameter (FolderItem.PathType…) or without checking file.exists ?

Checked on that and still having same problem.

Thanks

[quote=312751:@Oliver Scott-Brown]I went through changing the values and made sure all the correct files were in place on installing my app with InnoSetup. For some reason, it executes the code in unhandledexception event of the app which opens a text file with the error log. Usually the error log would appear but it doesn’t when I open the my installed app. If I open the original build then there is no error.

The annoying thing about the error log is there is nothing in the stack trace or no information to tell me what the error is. This error does not appear in the original build files but only when I copy ALL the files required to run the application.

It seems to execute the unhandledexception method twice.

Thanks[/quote]
It sounds as if the code in your UnhandledException event is raising another exception. Make sure that code is carefully crafted with try/catch code to prevent that. I suspect you’re getting an IOException due to a missing file or insufficient permissions though.

Actually just noticed now that it is NilObjectException but there is no stack.

This is the error checking I used and it seems really tedious to have to wrap all my method in try catch just to track down one error. I find it weird how it only occurs when installed. Does anybody get that? It is like there is some weird permissions problem or something.

  #pragma unused error
  #If DebugBuild = false then
    Dim d As New Date
    Dim f As New FolderItem
    f  = SpecialFolder.Desktop.Child(App.ExecutableFile.DisplayName+"_ERRORLOG.txt")
    If f.exists Then f.delete
    
    Dim t As TextOutputStream
    t=textoutputstream.create(f)
    
    If t = Nil Then Return False
    
    t.WriteLine "This file contains an error log for the PowerMode error." + EndOfLine + EndOfLine
    t.WriteLine "UnhandledException: " + Introspection.GetType(error).Name + EndOfLine
    t.WriteLine "Current date: " +  d.SQLDateTime + EndOfLine + EndOfLine
    t.WriteLine "Executable Name: " + App.ExecutableFile.DisplayName
    t.WriteLine "Executable Path: " + App.ExecutableFile.NativePath + EndOfLine
    t.WriteLine "Executable Size: " + Str( App.ExecutableFile.Length )
    t.WriteLine "Executable ModificationDate: " + App.ExecutableFile.ModificationDate.SQLDateTime
    t.WriteLine "Executable CreationDate: " + App.ExecutableFile.CreationDate.SQLDateTime + EndOfLine
    t.WriteLine "Error Message: " + error.Message + EndOfLine
    t.WriteLine "Stack: " + EndOfLine + Join( error.Stack, EndOfLine)
    t.Close
    
    f.Launch
    
    Quit
  #EndIf

Except that the way you’re creating the TextOutputStream, it will throw exceptions instead of just making things nil, so you MUST use try/catch here.

1 - Make sure everything has been installed. Look in c:\Program Files(x86) for your program, and verify that all files in Resources and Libs are there.

2 - Are you REALLY placing files ON THE DESKTOP ? Should they not rather be in Application data, or Temporary ?

3 - Are you sure all paths are good ?

Yayyy! Thanks for the help people.

[quote=313116:@Michel Bujardet]1 - Make sure everything has been installed. Look in c:\Program Files(x86) for your program, and verify that all files in Resources and Libs are there.

2 - Are you REALLY placing files ON THE DESKTOP ? Should they not rather be in Application data, or Temporary ?

3 - Are you sure all paths are good ?[/quote]

1 - Solved my problem
2 - Changed to app data