Results 1 to 9 of 9

Thread: Setup problem

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    61

    Setup problem

    Hello,

    The default installation of my setup project is as follows:

    [ProgramFilesFolder]\[Manufacturer]\[ProductName]

    The problem is PC in Europe don't have a "Program Files" folder, it's in a different language.

    When I remove [ProgramFilesFolder] from the setup program, the installation doesn't work. I would like to install the application in C:\AppFolder, any ideas how to resolve this problem?

    Thanks,

    Victor

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Setup problem

    The Program Files folder can have a different name (and even a different location too), but it does not matter - because the packaging program you are using should be able to automatically detect it (if it can't then it is badly made, so use a different one).

    How you should specify it depends on which packaging tool you are using, but it may be something like "%ProgramFiles%". Assuming that is the case, rather than specifying "C:\Program Files\MyFolder" you would specify "%ProgramFiles%\MyFolder"


    Not understanding how to use your packaging tool correctly is not a valid excuse for adding mess (such as extra root level folders) to peoples drives - particularly these days, as there is a high chance that you will get problems due the features in modern versions of Windows (such as virtualisation, DEP, ...).

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    61

    Re: Setup problem

    Hello,

    I am using Visual Studio 2005, the packaging tool comes with the default location: [ProgramFilesFolder]\[Manufacturer]\[ProductName]

    I don't understand why when I remove [ProgramFilesFolder] from the default location, the program doesn't install in c:\[Manufacturer]\[ProductName].

    I'm trying to avoid the Program Files folder because as mentioned PCs overseas name it in different languages.

    Thanks,

    Victor

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Setup problem

    I'm trying to avoid the Program Files folder because as mentioned PCs overseas name it in different languages.
    That is completely irrelevant - because it is not taken to mean "C:\Program Files", but whatever the name and location are on that particular computer.

    For example:
    - On a computer where the language is Spanish, it could be "C:\Archivos de Programa".
    - On any computer (no matter what language) it could be "Z:\Progs".

    You do not need to worry about the name or location of the Program Files folder, because the setup will automatically detect it (by basically 'asking' Windows where to find it).


    You are trying to solve a problem that does not actually exist - you should just use the default location.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    61

    Re: Setup problem

    Sorry for not being clear from the beginning.

    I understand your point, the problem is my application needs to access image files from a specific folder (hard coded in application), I can no longer use the "Program Files" folder to locate these images, therefore I want to use C:\ApplicationName" folder instead of the c:\Program Files\ApplicationName folder.

    The images are in a table in the following format:

    ID Image
    100 c:\Program Files\ApplicationName\Image1.png
    101 c:\Program Files\ApplicationName\Image2.png
    102 c:\Program Files\ApplicationName\Image3.png
    103 c:\Program Files\ApplicationName\Image4.png
    etc...

    I was trying to figure out how to avoid hard coding the path from the table
    by including: \.Image1.png in the table, but it doesn't work. Since the ACCESS file and the image files are in the same folder, this syntax should have worked, by I am unable to view the images unless I hard code the images file folder path, my alternate solution is to use c:\ApplicationName\Imagex.png

    Thanks,

    Victor

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Setup problem

    I see, well in that case what you should do is only hard-code the path from after the application folder (eg: 100 \Image1.png), and then use code to detect the application folder (which I think is Application.StartupPath).


    Note that any files that can be edited (which always includes Access files, even if you aren't intentionally editing them) should not be stored in ProgramFiles, as that causes various problems (including permissions and virtualisation).

    Instead those files should be stored in AppData folders. For more information, see the article Where should I store the files that my program uses/creates? (but ignore the code, it is for Classic VB)
    Since the ACCESS file and the image files are in the same folder, this syntax should have worked,
    Actually it shouldn't work, at least not reliably - because relative paths are not based on the location of a file, but whatever the current working directory is. As that is not a consistent value (it can change each time your program runs, or even while it is running), using relative paths is not a safe thing to do.

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    61

    Re: Setup problem

    Below is the code that I am using to view the image files from crystal report.
    As mentioned the images only show when I hard code the folder path in the image field. I am already using the Apploication.StartPath to access the databse, just can figure out how to view the images with out hard coding the path. I would settle for hard coding the path, only if there is a way to install the program without the Program Files folder as the default path. What would you suggest? Thanks for all your help.

    Dim myaop6report As New AOP6Annex
    Dim myaop6viewer As New AOP6VIEWER
    Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo

    crConnectionInfo.ServerName = (Application.StartupPath & "\AOP6Annexes.mdb")
    setDBLogonForReporta(crConnectionInfo, myaop6report)
    myaop6report.RecordSelectionFormula = "{image.SN} like " & "'*" & 100 & "*'" & ""

    With myaop6viewer
    .CrystalViewer22.DisplayGroupTree = True
    .CrystalViewer22.ReportSource = myaop6report
    .Show()
    End With
    Me.Cursor = Cursors.Default

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Setup problem

    That code does not actually specify the images at all, let alone a path for them.

    I have no idea how VB.Net can interact with Crystal, but somehow you need to find a way of telling it which path to find the images in. That may be via a function in VB that Crystal can call, or by adding a field (or similar) to the report which you put the path in to.

  9. #9

    Thread Starter
    Member
    Join Date
    Nov 2008
    Posts
    61

    Re: Setup problem

    OK, I will find out more about how to acces the path from crystal report, rather than hard coding it in the database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width