Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 13 of 13
  1. #1
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144

    Star Writing OS name in text file

    I have a problem that I thought was easy to fix but I have no idea why it doesn't work! I want my installer to write in this text file I have in the program
    s Program Files folder the user's system's OS and some more information. This is what I put:

    Code:
    osname = System.GetOSName();
    TextFile.WriteFromString("C:\Program Files\ProgramName\FileName.txt", osname, false);
    Why doesn't it work? Also, where should I put it?? Maybe that is the problem... HELP!! Thanks!

  2. #2
    Join Date
    Dec 2004
    Location
    Texas
    Posts
    239
    Try:

    Code:
    osname = System.GetOSName();
    TextFile.WriteFromString("C:\\Program Files\\ProgramName\\FileName.txt", osname, false);
    Make sure to use double \\ in your code. Hope this helps.

  3. #3
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    Sorry to say... Your script doesn't work... Thank you for trying... Any other ideas?

  4. #4
    Join Date
    Dec 2004
    Location
    Texas
    Posts
    239
    Ok I'm going to assume the problem is that ProgramName is a session variable. Try this:

    Code:
    AppFolder = SessionVar.Expand("%AppFolder%");
    osname = System.GetOSName();
    TextFile.WriteFromString(AppFolder.."\\FileName.txt", osname, false);

  5. #5
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    This is really agrivating me... DOESN'T WORK! WHY? It seems so simple... could you make a project that does what I want mine to do and attach it? Thanks..

  6. #6
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    Try adding this after the TextFile action:

    Code:
    -- Test for error
    error = Application.GetLastError();
    if (error ~= 0) then
    	Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
    end
    What does the error say?

    Adam.

  7. #7
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    Adam, I added your script and it didn't tell me anything... And it also didn't do it's job. What now? could you make a project that does what I want mine to do and attach it? Thanks..

  8. #8
    Join Date
    May 2000
    Location
    Indigo Rose Software
    Posts
    2,150
    I just tested this code and it seems to work fine for me:

    Code:
    osname = System.GetOSName();
    TextFile.WriteFromString("C:\\MyFile.txt", osname, false);
    File.Open("C:\\MyFile.txt", "", SW_SHOWNORMAL);
    Start by getting this working and then move onto the other variables and such.

    Adam Kapilik

  9. #9
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    Maybe it doesn't work because I'm using Vista? This program is older than vista so...

  10. #10
    Join Date
    Jun 2005
    Posts
    470
    SF isn't 'older than Vista', setups generated with the latest 7.0.6.1 work OK in it. However, Vista doesn't like some things - like writing to the root of C:\ or to \Program Files.
    An installer is normally allowed to write there after you confirm UAC warnings, but you may have some specific configuration that causes a problem.

    In the sample code, try to replace C:\MyFile.txt with a location where you surely have write access, like your desktop folder or My Documents folder.
    Also check if it works if you right-click the setup .exe and select 'Run as administrator' from the context menu.

  11. #11
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    aren't we talking AutoPlay Media Studios 6?

  12. #12
    Join Date
    Dec 2004
    Location
    Texas
    Posts
    239
    This is the Setup Factory 7 forum.

  13. #13
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    ohh ok... Sorry... That's what I ment

Similar Threads

  1. Best way to share custom buttons with the group?
    By mwreyf1 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 04-28-2010, 01:29 PM
  2. Help! Submit from a text file to a website
    By wedgea09 in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 05-15-2007, 01:22 PM
  3. HELP: Trying to create a bookmark for audio
    By Ren in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 09-12-2005, 05:20 AM
  4. Import data from a text file
    By StealthFD in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-28-2004, 05:08 PM
  5. problems parsing text file...
    By Martin_SBT in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 02-02-2004, 01:16 PM

Posting Permissions

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